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

From: Thomas Lord <lord>
Date: Fri, 22 Jun 2007 11:58:03 -0700

Arthur Smyles wrote:
> Thomas Lord wrote:
>
>> I don't have a cite handy but maybe someone can play with
>> Google to find it. Sun Microsystems, some years ago,
>> published a long paper called something like "everything programmers
>> need to know about floating point numbers" which I would like
>> to recommend.
>>
>
> http://portal.acm.org/citation.cfm?id=103163.
>
> Unfortunately, it's not public :(
>

Then you should also work on your web search skills :-)

Here is a copy of the paper:

www.physics.ohio-state.edu/~dws/grouplinks/*floating*_*point*_math.pdf


And, oh, looks like there are some slides for a related talk -- those
might be interesting (I've only glanced at them so I can't say for sure):

blogs.sun.com/darcy/resource/Wecpskafpa-ACCU.pdf


-t


> Arthur
>
>>
>> Arthur Smyles wrote:
>>
>>> Second, +inf and -inf are not ranges they are points.
>>>
>> That's wrong too.
>>
>> 1.0 / 0.0 == +inf for a very specific reason: that "0.0" might not
>> actually mean "naught". In particular, "0.0" might mean "a very,
>> very small positive Real number (or negative)". Thus, "+inf"
>> means "a very, very large Real number."
>>
>>
>> A visualization that I can't do much justice to in ASCII might
>> help:
>>
>> There are a finite number of bit patterns corresponding to floating
>> point numbers. These are distributed on the real line (except for
>> NaN). They are distributed unevenly:
>>
>>
>> ...============== -1 === 0 === 1 ===============...
>> ^ ^ ^ ^ ^ ^ ^ ^^^^^^^^^^^^ ^ ^ ^ ^ ^ ^ ^
>>
>> Each bit pattern is the name for the interval formed by splitting the
>> distance to its neighbors. For example, "0.0" really means "plus
>> or minus epsilon".
>>
>> Since the list of bit patterns is finite, it has a start and end --
>> there smallest and largest floating point bit patterns. Each of those
>> has no neighbor on one side:
>>
>>
>> ========================
>> ^ ^ (no
>> neighbor on this side)
>> +inf
>>
>>
>> Those "inf" values therefore stand for half-infinite intervals.
>>
>> When you ask a floating point unit to compute something like x/y
>> you are asking, in effect "Suppose I know that there is a number X in
>> one interval, and a number Y in another interval -- In what interval
>> can I find the quotient of these numbers, if it exists?"
>>
>> The "+inf" and "-inf" answers tell you "The quotient might exist
>> and, if so, it is very very large or very very small".
>>
>> When an operation gives you "NaN" it is telling you that "Either
>> the floating point circuits can prove that no answer exists or
>> they can prove that they can not prove that any answer might exist."
>>
>>
>>
>>
>> -t
>>
>>
>
> _______________________________________________
> r6rs-discuss mailing list
> r6rs-discuss at lists.r6rs.org
> http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
>
>
Received on Fri Jun 22 2007 - 14:58:03 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC