Closed frenchfaso closed 4 years ago
Hello there, the ">" operator behaves weirdly, the following code:
for x = -2776 to -2760 if x > 30000 then print "{LIGHT_GREEN}true ", x else print "{LIGHT_RED}false ", x endif next x
gives this output:
changing 30000 "moves" the error, for instance with 29995 this is the output:
The "<" operator doesn't seem to have similar issues, but I have not tested it thoroughly.
Hi. It's somehow related to the number -2767: because 30000+2767=32767, the upper limit of the signed 16-bit integer, but the comparison result is indeed wrong. I'll have a look. Thanks for spotting it out!
Hello there, the ">" operator behaves weirdly, the following code:
for x = -2776 to -2760 if x > 30000 then print "{LIGHT_GREEN}true ", x else print "{LIGHT_RED}false ", x endif next x
gives this output:
changing 30000 "moves" the error, for instance with 29995 this is the output:
The "<" operator doesn't seem to have similar issues, but I have not tested it thoroughly.