Code:
local A&, B% local BSlashQuotient, FixQuotient as integer A& = 400000 B% = 6 BSlashQuotient = A& \ B% FixQuotient = fix (A& / B%) ? A& B% BSlashQuotient FixQuotient
400000 6 1130 -32768
using long quotients, the output is:
400000 6 66666 66666
With integer quotients, when overflow occurs:
fix (A/B) always = -32768
A\B always = the correct integer quotient - 65,536.
Does anyone know why?
And, is there any way to generate a run-time warning when overflow occurs?
Comment