ID: 30191 Updated by: [EMAIL PROTECTED] Reported By: roberto at spadim dot com dot br -Status: Open +Status: Bogus Bug Type: *Math Functions Operating System: linux, windows xp PHP Version: 5.0.1 New Comment:
Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. Thank you for your interest in PHP. http://www.php.net/manual/en/language.types.float.php Previous Comments: ------------------------------------------------------------------------ [2004-09-22 06:24:39] roberto at spadim dot com dot br Description: ------------ sum error: 590-589.99!=0.01 Reproduce code: --------------- <?php echo 590-589.99; echo "\n"; echo (double)(590)-(double)(589.99); ?> Expected result: ---------------- 0.01 0.01 Actual result: -------------- 0.0099999999999909 0.0099999999999909 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30191&edit=1
