PHP 5.6.31 Released

Voting

Please answer this simple SPAM challenge: two plus one?
(Example: nine)

The Note You're Voting On

Anonymous
7 months ago
Note that PHP 5.3 didn't just introduce $mode, it rewrote the rounding implementation completely to eliminate many kinds of rounding errors common to rounding floating point values.

That's why round() gives you the correct result even when floor/ceil don't.
For example,  floor(0.285 * 100 + 0.5) VS round(0.285*100 + 0.5). First one gives 28, second one gives 29.

More details here: https://wiki.php.net/rfc/rounding

<< Back to user notes page

To Top