Skip to content

[Bug]: Inconsistent results when rounding negative values #1040

@oskostenko

Description

@oskostenko

Contact Details

No response

Compiler version

v1.18.5

What happened?

Negative variables are rounded downwards, while negative contstants are rounded upwards.

dim   var_neg   as fixed = -1.5
const const_neg as fixed = -1.5

print cast(integer, var_neg)    ' -2
print cast(integer, const_neg)  ' -1

The same results are observed with floats.

Error and Warning messages

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions