Check out this code:
Man this took me AGES to whittle down. Anyway if you run it in debug mode it prints 30. Run it in normal mode and it prints 29.
If I change the return param of CalcAnimLength from a float to a double or an int, the result is the same in both modes i.e. correct.
Also this is a good example of how a float to int conversion can go badly wrong anyway because according to Windows Calc 150/25/0.2 = 30 but in Blitz the float is like 29.99999 something and this gets truncated down to an int of 29! So basically don't rely on the compile to convert float to int for you, either keep the end result as an in or use a special rounding function to do it properly.
Anyway, if everyone concurs that the compile is working differently in debug mode then I can post this in the bug forum.
SuperStrict Global frl!=25 Global currentspeed!=0.2 Local length% = CalcAnimLength(150) Print length Function CalcAnimLength#(ms%) Return ms/frl/CurrentSpeed End Function
Man this took me AGES to whittle down. Anyway if you run it in debug mode it prints 30. Run it in normal mode and it prints 29.
If I change the return param of CalcAnimLength from a float to a double or an int, the result is the same in both modes i.e. correct.
Also this is a good example of how a float to int conversion can go badly wrong anyway because according to Windows Calc 150/25/0.2 = 30 but in Blitz the float is like 29.99999 something and this gets truncated down to an int of 29! So basically don't rely on the compile to convert float to int for you, either keep the end result as an in or use a special rounding function to do it properly.
Anyway, if everyone concurs that the compile is working differently in debug mode then I can post this in the bug forum.