Re: Simple math failing - PHP Bug?

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

 



From: "Chris Shiflett" <shiflett@xxxxxxx>
To: "Jason Wong" <php-general@xxxxxxxxxxxx>; <php-general@xxxxxxxxxxxxx>
Sent: Monday, November 01, 2004 12:22 AM
Subject: Re:  Simple math failing - PHP Bug?


--- 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. :-)

Wouldn't help. Exact same problem.

The root cause it trying to express the number range of 0.0-1.0 in a finite set of bits. The more bits you use, the smaller the gaps between the numbers exactly represented, but there are always an infinite number of "numbers" in every gap.

It works well enough as an approximation to be useful; the Fortran programmers use format clauses just like any other programmer to force rounding to a known precision.

Mark C., who's worked on all the Fortrans up to 95.

--
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