Re: Simple math failing - PHP Bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Shiflett wrote:

--- Jason Wong <php-general@xxxxxxxxxxxx> 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux