note 73925 added to function.round
| From: | php-general at lists dot php dot net | Date: | Thu, 15 Mar 2007 21:11:43 +0000 |
| Subject: | note 73925 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124492@lists.php.net to get a copy of this message | ||
With regard to chafy at alo dot bg's not just previous; if the number 5.555 is displayed with
sufficient precision (more than about 16 digits) it will probably turn out to have been stored as
something like 5.554999999....9997, which would round down to 5.55.
Floating-point numbers should ALWAYS be regarded as being a little bit fuzzy. It's a
consequence of the fact that they're stored in binary but humans want them displayed in
decimal: you can't write one-tenth exactly as a binary expansion any more than you can write
one-seventh exactly as a decimal one.
See the warning note on the floating-point type page.
----
Server IP: 203.89.181.184
Probable Submitter: 60.234.168.92
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- https://master.php.net/note/edit/73925
Del: integrated -- https://master.php.net/note/delete/73925/integrated
Del: useless -- https://master.php.net/note/delete/73925/useless
Del: bad code -- https://master.php.net/note/delete/73925/bad+code
Del: spam -- https://master.php.net/note/delete/73925/spam
Del: non-english -- https://master.php.net/note/delete/73925/non-english
Del: in docs -- https://master.php.net/note/delete/73925/in+docs
Del: other reasons-- https://master.php.net/note/delete/73925
Reject -- https://master.php.net/note/reject/73925
Search -- https://master.php.net/manage/user-notes.php