[R6RS] IEEE 754 wizard help needed
Mon Jul 4 12:26:29 EDT 2005
dyb at cs.indiana.edu writes:
>> 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.
I should have been more clear: Assume the underlying representation
*is* IEEE 754. According to that, (sqrt -0.0) => -0.0, I believe, so
that doesn't help.
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
More information about the R6RS