[r6rs-discuss] [Formal] Formal Comment: NaN should be considered a number, not a real

Aubrey Jaffer agj at alum.mit.edu
Tue Jun 26 16:15:03 EDT 2007


 | Date: Sun, 24 Jun 2007 15:06:32 -0400
 | From: John Cowan <cowan at ccil.org>
 | 
 | Aubrey Jaffer scripsit:
 | 
 | > | Date: Sat, 23 Jun 2007 00:01:44 -0400
 | > | From: John Cowan <cowan at ccil.org>
 | > | ...
 | > | However, nan.0+1i is what you get when you do the following
 | > | computation, given that IEEE 64-bit floats are in use:
 | > |
 | > | 	(- (+ 1e308+1i 1e308+1i) (+ 1e308+0.5i 1e308+0.5i))
 | > 
 | > SCM on i686 uses IEEE-754 64-bit floats and it returns NaN:
 | > 
 | >  (- (+ 1e308+1i 1e308+1i) (+ 1e308+0.5i 1e308+0.5i))  ==>  0/0
 | 
 | Okay, you made it do so.  What of it?

You claimed that the result is nan.0+1i.  It is not in at least one
major Scheme implementation (and has been that way for a while).

 | > Where in IEEE-754 does it specify how to compute complex addition?
 | 
 | Why do you ask me this rhetorical question?

You appealed to IEEE-754, I assume as justification for your claim.
But IEEE-754 does not discuss numbers with imaginary parts.



More information about the r6rs-discuss mailing list