Re: Simple math failing - PHP Bug?

From: Date: Mon, 01 Nov 2004 05:29:03 +0000
Subject: Re: Simple math failing - PHP Bug?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200809@lists.php.net to get a copy of this message
Chris Shiflett wrote:
--- Jason Wong <php-general@gremlins.biz> wrote:
Most computer languages handling floating point calculations just as poorly. If accuracy is important use the BCMath functions.
Or use Fortran and double precision. :-) Still, testing a floating point number as a boolean is one of the worst ideas I've ever heard... Chris ===== Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly     HTTP Developer's Handbook - Sams
Coming January 2005         http://httphandbook.org/
Well, in fairness, it's one of the worst ideas you've ever heard because you know of this limitation.
In reality, using a calculator or something that doesn't share this limitation, 0 = 0 and this wouldn't be a problem. It's only when 0 = 0.0000000000001342344 that this becomes a problem. Brian

« previous php.general (#200809) next »