From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Jason Wong" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, November 01, 2004 12:22 AM
Subject: Re: [PHP] Simple math failing - PHP Bug?


--- Jason Wong <[EMAIL PROTECTED]> 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



Reply via email to