Thomas Lord wrote: > 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 > I got a File Not Found on this one > > 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 > > Interesting paper. Thanks
One comment about it. The relevant slide to what this discussion is about is on page 8. Level 1 is the real math. Level 2 is to make the system algebraically completed. Obviously this property is important which is why NaN should still be considered a number. However, it is also clear that it is not a real number on Level 1. And since in complex number a+bi, a and b must be real numbers, it should also not be considered a complex number. Hence my proposed changes to fix the number types in Scheme to match the mathematical types. Arthur > -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 >> [email protected] >> http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss >> >> > _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
