[r6rs-discuss] [Formal] NaN is not a real number.
submitter's name: Aubrey Jaffer
submitter's email address: agj_at_alum.mit.edu
type of issue: Defect
priority: Minor
R6RS component: Arithmetic
version of the report: 5.91
one-sentence summary of the issue:
NaN is not a real number.
full description of the issue:
Page 10: 2.4. In?nities and NaNs
A NaN is regarded as a real (but not rational) number whose value
is so indeterminate that it might represent any real number,
including positive or negative in?nity, and might even be greater
than positive in?nity or less than negative in?nity.
+inf.0 and -inf.0 are real numbers because they are part of the total
ordering of that subset of the real numbers represented in Scheme.
NaN is not part of that ordering; thus it is not a real number. It
is, however, a complex number.
(/ 0.0 0.0) is NaN because any finite number satisfies the equation:
z * 0.0 = 0.0.
And that includes any finite complex number! Restricting NaN to be
real is wrong.
In page 10, "2.4. In?nities and NaNs", I propose the sentence should
be changed to read:
A NaN is regarded as a complex number whose value is so
indeterminate that it might represent any complex number.
On page 38, the line:
(real? +nan.0) ==> #t
should be changed to:
(real? +nan.0) ==> #f
Because it doesn't participate in the ordering, +nan.0 is not an
acceptable argument to numerical-ordering predicates (<, <=, >, >=,
negative?, positive?, etc).
On page 100, the lines
(fl= +nan.0 fl) ==> #f
(fl< +nan.0 fl) ==> #f
should be removed.
Received on Wed Sep 20 2006 - 15:23:55 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC