Author:
Date: Jul 11, 2008 03:30
>{...snip...}
>>
>> What answer to divide by 0 is less ridiculous than 2**31 - 1? After
>> all, the limit of a/x as x approaches 0 is infinity. You are not
>> going to get any closer to infinity than 2**31 - 1 with a 32 bit
>> signed integer.
>
>Only if a and x are of the same sign. If they are of different sign,
>the limit is -oo. And you can't get any farther from -oo than 2**31-1
>with a 32-bit signed integer. And if a=0, none of this, including your
>statement, applies, because in that case the limit is zero, which is
>only one of an inifinite number of solutions.
...and DCL attempts this too:
$ WRITE SYS$OUTPUT 1/0
2147483647
$ WRITE SYS$OUTPUT -1/0
-2147483648
|