[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Rational Infinity
I assume that if this becomes a real proposal, there would be
trap-enable equivalents for rational infinities and rational NaNs
analogous to IEEE trap enables for overflow, underflow, etc. For
example, one possible syntax might be
(with-rational-trap-enables ((:divide-by-zero :infinity))
(/ a b))
might return 1/0 or -1/0 silently, while
(with-rational-trap-enables ((:divide-by-zero :error))
(/ a b))
would signal an error. In systems that have condition handling and/or
proceed options, the program and/or user could decide to use +-1/0 if
that seemed like a good thing to do at the time.
Once generated (i.e., in the dataflow of the program), rational
infinities don't cause further traps unless you divide two infinities or
multiply an infinity by 0. For example, (sqrt 1/0) would return 1/0,
(* 1/0 positive-number) would return 1/0, etc.