QB64-Phoenix-Edition / QB64pe

The QB64 Phoenix Edition Repository
https://qb64phoenix.com
Other
132 stars 26 forks source link

Unary negation does not work correctly when using CONST #542

Closed a740g closed 2 weeks ago

a740g commented 1 month ago

Describe the bug Unary negation does not work correctly when using CONST. As @mkilgore figured out, the unary negation only works correctly for integers. See here.

To Reproduce

CONST C1! = -1.4!
CONST C2! = -0.4!
CONST C3! = 0.4!
CONST C4! = 1.4!

PRINT C1, C2, C3, C4

The above code prints: -1 0 .4 1.4

Expected behavior It should handle unary negation correctly for both integer and floating-point values.

Additional context This was first reported here.