Division by zero
Charles Turner
chturne@gmail.com
Fri Oct 28 07:19:00 GMT 2011
On 28 October 2011 01:31, John-Paul Verkamp <verkampj@umail.iu.edu> wrote:
> Mostly out of curiosity, why doesn't division by zero raise an error?
>
> #|kawa:1|# (/ 1 0)
> 1/0
>
> But div does:
>
> #|kawa:2|# (div 1 0)
> /dev/stdin:3:1: warning - call to #<procedure div> throws
> java.lang.ArithmeticException: / by zero
I think this is due to incomplete support for "exact infinities". I
posted about a similar issue on the mailing lists, and Per explained
why he chose to handle the cases differently and what he thought was
required to implement it:
http://sourceware.org/ml/kawa/2011-q2/msg00029.html
HTH,
Charles.
More information about the Kawa
mailing list