[racket-dev] exact 0 and floating point operations
Currently, when given inputs some of which are floats, `*', `+', '/'
and `-' almost always produce floats. However, there are some cases
where this is not true:
(* flt 0)
(/ 0 flt)
Unfortunately, this makes the job of the typechecker and optimizer
harder (since * and / don't have the closure properties you'd want).
It's also not fully documented. Here's the quote from the
documentation:
"Certain operations on inexact numbers, however, produce an exact
number, such as multiplying an inexact number with an exact 0."
I'd like it if these were changed to always produce floats, but I'd
settle for complete documentation so that I can give everything the
right type.
--
sam th
samth at ccs.neu.edu