Floats and Doubles

Seth Kurtzberg seth@cql.com
Tue, 12 Nov 2002 08:09:33 -0700


If that is a serious question, then the answer is that if you want to take 
advantage of floating point hardware you are in general limited to those 
representations that the hardware understands.

Also, most floating point representations have a binary field for what is 
effectively the significant digits of the number you are representing, and 
thus there are some conversion and roundoff errors built into the 
representation.  It is of course possible to use something more akin to a BCD 
representation, and if you are willing to live with the performance impact, 
then that is fine.  That should be, however, another type, because in many 
cases the performance loss is unacceptable and the roundoff errors are 
insignificant.

On Tuesday 12 November 2002 07:10 am, Jerzy Karczmarczuk wrote:
> Lennart Augustsson wrote:
>  > The number 5.2 is stored
> >
> > as a slightly different number as a Float, but the toRational function
> > is exact
> > so it gives you the number corresponding to the internal representation.
> > Take a course on numerical analysis. :)
>
> Nope. Take a course entitled:
>    Why all you zombies must remain forever slaves of IEEE-something (477?),
>    and why you should be happy with this.
>
> Jerzy Karczmarczuk
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

-- 
Seth Kurtzberg
M. I. S. Corp
seth@cql.com
1-480-661-1849 (GMT-7)