|
|
Nathan Kopp <Nat### [at] koppcom> wrote:
: Yes. I've known about this problem for a while now, but I don't know
: exactly how to fix it (or even how it should be fixed exactly).
I don't think there's any portable way of detecting whether the FPU (or
the CPU for that matter) made a division by 0 or not.
Since we are handling real numbers here (the set or real numbers does not
have +infinity nor -infinity), a division by 0 is undefined, so there's no
"correct" behaviour if it happens.
Even if we had +infinity and -infinity, the value of 1/x when x is 0 is
undefined. You can't actually say whether it's +infinity or -infinity since
it depends on which side of the y-axis you are looking from (ie. if x
approaches 0 from the positive values, the result will approach +infinity,
but if it approaches from negative values it will be -infinity).
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|