ID: 49112 Updated by: [email protected] Reported By: marek at 3v dot ie -Status: Open +Status: Bogus Bug Type: Math related Operating System: Fedora 9 PHP Version: 5.2.10 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. 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 Thank you for your interest in PHP. . Previous Comments: ------------------------------------------------------------------------ [2009-07-30 16:56:57] marek at 3v dot ie Description: ------------ When I try to substract specific float numbers I receive a wrong result Reproduce code: --------------- echo (35.19 - 31.69 - 3.50); echo (36.19 - 31.69 - 2.50); Expected result: ---------------- 0 Actual result: -------------- -3.5527136788005E-15 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49112&edit=1
