[FRPythoneers] Numerical Accuracy

Evelyn Mitchell efm at tummy.com
Sat May 18 14:23:46 MDT 2002


Python does not support IEEE 754:
  http://www.amk.ca/python/dev/2000-10-1.html

There's an open PEP:
  http://www.python.org/peps/pep-0228.html

Python supports C and Posix floating point standards.

Evelyn

* On 2002-05-18 20:17 Sean Reifschneider <jafo at tummy.com> wrote:
> On Sat, May 18, 2002 at 01:44:45PM -0600, Evelyn Mitchell wrote:
> >>>> 29.8
> >29.800000000000001
> >
> >Looks like a bug to me.
> 
> Fast floating point approximations sometimes are very bad at dealing with
> certain values.  They go under the assumption that it's ok to be close
> enough (and to me, 15 digits of precision is close enough for my use).
> 
> It's not so much a bug as a trade-off definied by (probably) IEEE fast
> floating point mechanisms.  The bigger problem is when you find that 2.0 +
> 2.0 != 4.0 -- because of rounding errors and the like...  Which is part
> of the reason I will usually check for "< 1" instead of "== 0"...
> 
> Sean
> -- 
>  "Who's the guy in the suit?"  "FBI."  "He looks a little to much like a
>  lounge lizard for FBI."  "He's working under-cover."  -- Sean & Evelyn 2000
> Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
> tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python
> _______________________________________________
> This message sent by the FRPythoneers mailing list.
> Unsubscribe: echo unsubscribe | FRPythoneers-request at lists.community.tummy.com
> URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers

-- 
Regards,                    tummy.com, ltd 
Evelyn Mitchell             Linux Consulting since 1995
efm at tummy.com               Senior System and Network Administrators
                            http://www.tummy.com/



More information about the FRPythoneers mailing list