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

Aubrey Jaffer agj at alum.mit.edu
Sun Jun 24 13:59:44 EDT 2007


 | Date: Sat, 23 Jun 2007 00:01:44 -0400
 | From: John Cowan <cowan at ccil.org>
 | 
 | Arthur Smyles scripsit:
 | 
 | > ... Besides, you would never create a complex number for
 | > nan.0+1i, you would convert it to nan.0 instead.

Yes!

 | 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

Where in IEEE-754 does it specify how to compute complex addition?



More information about the r6rs-discuss mailing list