[PHP-DEV] Re: Rounding in PHP and floating point numbers in general

2008-07-22 Thread Umberto Salsi
Posting to newsgroup php.internals, you wrote: [...] round(), on the other hand, does more than the standard C functions do: With the additional places argument, it allows to round not only to integers but to arbitrary places. And this is precisely the thing that causes all the problems. ;-)

Re: [PHP-DEV] Re: Rounding in PHP and floating point numbers in general

2008-07-22 Thread Christian Seiler
Hi! Note too that the value actually stored in $f differs from that we may expect simply reading the source: the difference is very small, but it exists. Float values can always be converted back in decimal base with exact precision, so for example in our case the $f variable now contains