Closed
Description
CONST evaluates -2 ^ 2
as (-2) ^ 2
and thus gives 4. However, if you actually evaluate this expression in Ex. a PRINT
statement you'll find it evaluates to -4
because QB64's order of operations treat that as -(2 ^ 2)
, exponentiation is higher then negation.
I'm considering this a bug since CONST
should have the same operator order as regular QB64 (IE. Any expression evaluated as CONST
should give exactly the same value as evaluating it as a non-CONST
), but it's notable that exponents are not allowed to be in CONST
expressions in QB45 for some reason, so this is not a compatibility issue with QB45.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
Activity