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:![vice-screen-20200902103639](https://user-images.githubusercontent.com/1913203/91959308-b925b980-ed08-11ea-9de0-b029f9866e34.png)
changing 30000 "moves" the error, for instance with 29995 this is the output:![vice-screen-20200902103839](https://user-images.githubusercontent.com/1913203/91959377-d0fd3d80-ed08-11ea-9428-7106658ddb6e.png)
The "<" operator doesn't seem to have similar issues, but I have not tested it thoroughly.