RE: [PHP] More math fun
| From: | Jay Blanchard | Date: | Wed, 13 Aug 2008 13:51:53 +0000 |
| Subject: | RE: [PHP] More math fun | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278027@lists.php.net to get a copy of this message | ||
[snip]
> 1.7763568394E-15 is 0. The computer just had a rounding error
somewhere. We
> had this discussion a few weeks ago, the solution being to decide to
what
> accuracy you want the answer. Upto 14 decimal places will give you 0
here!!
I thought we had a different discussion a couple of weeks ago about
floating point storage precision. How come only Jay is getting *this*
rounding error?
[/snip]
Perhaps it is the PHP version? I have tried this on three separate PHP
installations (all the same configs) and got the same results. I will
look to see if there is an upgraded version.
When applying round to the numbers everything works out as expected, but
makes me uncomfortable.