note 66449 added to function.round
| From: | JohnBentley at osu1 dot php dot net | Date: | Tue, 23 May 2006 02:15:22 +0000 |
| Subject: | note 66449 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111844@lists.php.net to get a copy of this message | ||
It's important when talking about rounding that we be clear
on the direction we mean. For they are different:
Original Rounded
Towards Positive Infinity
4.3 5
-4.3 -4
Towards Negative Infinity
4.3 4
-4.3 -5
Toward Zero
4.3 4
-4.3 -4
Away from zero
4.3 5
-4.3 -5
Towards the nearest number
4.3 4
-4.3 -4
5.3 5
-5.3 -5
Towards the even number.
4.3 4
-4.3 -4
5.3 6
-5.3 -6
Note: We can speak of rounding a number even though we are not at the halfway mark. That is, the
examples above are deliberately at the .3 interval rather than .5.
----
Server IP: 203.16.234.19
Probable Submitter: 59.167.14.102
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- http://master.php.net/note/edit/66449
Del: integrated -- http://master.php.net/note/delete/66449/integrated
Del: useless -- http://master.php.net/note/delete/66449/useless
Del: bad code -- http://master.php.net/note/delete/66449/bad+code
Del: spam -- http://master.php.net/note/delete/66449/spam
Del: non-english -- http://master.php.net/note/delete/66449/non-english
Del: in docs -- http://master.php.net/note/delete/66449/in+docs
Del: other reasons-- http://master.php.net/note/delete/66449
Reject -- http://master.php.net/note/reject/66449
Search -- http://master.php.net/manage/user-notes.php