RE: [PHP] round()
| From: | Instruct ICC | Date: | Fri, 12 Oct 2007 19:55:40 +0000 |
| Subject: | RE: [PHP] round() | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263167@lists.php.net to get a copy of this message | ||
> > > Yes, but precision is not the issue.
> > >
php -r '$t=123.45; echo $t . "\n"; $t+=0.00000000001; echo $t . "\n";'
123.45
123.45000000001
php -r '$t=123.45; echo $t . "\n"; $t+=0.000000000001; echo $t .
"\n";'
123.45
123.45
php -r '$t=123.45678901234567; echo $t . "\n";'
123.45678901235
Geee garbage in, garbage out.
round would have been given garbage to process depending upon the precision desired.
Anyway, you can still believe what you want. I see others agree.
_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline