On Feb 10, 2006, at 3:15, Joshua Isom wrote:

[ quoting rearranged - please don't toppost ]

On Feb 9, 2006, at 6:20 PM, Leopold Toetsch wrote:

$ cat div.pasm
set I0, 0x80000000
div I1, I0, -1
print I1
print "\n"
end

Why not case it to switch it to 0x7fffffff? In any case, if the code's added in to check for it an to throw an exception, then wouldn't it be more friendly to return as close to what's expected, and just call it "magical rounding"?

2^31-1 is close but of course wrong. Given that other native int operations just wrap around, 0 is as valid but OTOH far away from the correct result ;)

But out of curiosity, why would integer division be a floating point exception?

Lack of interrupt slots on x86?

And why doesn't it set the overflow bit?


Oh, and on my iBook g3, I get -1.

Wow.

leo

Reply via email to