Zero bitshifting a negative number results in 1.67772e+07 instead of the expected value
Numbered Steps to Reproduce Problem:
1. Zero-bitshift a negative number
2. The value will be 1.67772e+07
Code Snippet (if applicable) to Reproduce Problem:
world.log << (12.9 >> 0)
world.log << (-12.9 >> 0)
Expected Results:
12, -12
Actual Results:
12, 1.67772e+07
Does the problem occur:
Every time? Or how often? Every time
In other games? n/a
In other user accounts? n/a
On other computers? n/a
When does the problem NOT occur?
n/a
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unsure.
Workarounds:
n/a
16777204 is 2^24-12, the same bit pattern -12 should have in a 24-bit signed integer but interpreted as unsigned instead.
edit: changed last line from 0x1FFFFFF (rounding to 0x2000000) to 0x1FFFFFE (staying as 0x1FFFFFE) as it confused the results