ID: 35898 Updated by: [EMAIL PROTECTED] Reported By: matt at equaliser dot net -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: Linux PHP Version: Irrelevant New Comment:
There's nothing wrong with round()'s docs. See also 'precision' php.ini setting. Previous Comments: ------------------------------------------------------------------------ [2006-01-04 21:09:17] matt at equaliser dot net Description: ------------ Documentation reads round -- Rounds a float Description float round ( float val [, int precision] ) Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default). Should read: Returns the rounded value of val's floating point representation in memory to specified precision (number of digits after the decimal point). WARNING: This function may not return expected results for floating point numbers in memory whose string representation ends in a 5. eg: round (7.875 , 1); returns '7.88' $a = 45; $b = $a * .175; round ($b , 1); May return either '7.88' or '7.87'. See http://www.php.net/manual/en/language.types.float.php If you would like to know more about "floats" and what IEEE 754 is read this: http://docs.sun.com/source/806-3568/ncg_goldberg.html $ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35898&edit=1
