[R6RS] IEEE 754 wizard help needed
dyb at cs.indiana.edu
Mon Jul 4 10:40:32 EDT 2005
> Imagine a R5RS Scheme implementation where
> (/ 1.0 0.0) and (/ 1.0 -0.0)
> signal an error, and where
> (= 0.0 -0.0) => #t
> (eqv? 0.0 -0.0) => #t
> Is there a way to distinguish 0.0 and -0.0 without going through
It's difficult to say without knowing the underlying representation and
operators. Clearly, if there's no separate representation for -0.0, there
won't be any way to distinguish 0.0 and -0.0, even with number->string.
If there is a separate representation, it may be that (real? (sqrt -0.0))
is #f, and there may be other similar ways of detecting the difference.
More information about the R6RS