ID: 34442 Updated by: [EMAIL PROTECTED] Reported By: thirteenlisk at gmail dot com -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Windows XP PHP Version: 5.0.5 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: ------------------------------------------------------------------------ [2005-09-09 18:22:02] thirteenlisk at gmail dot com Description: ------------ Using intval() with some numbers produces an incorrect value. This applies these two specific values: 10.2 and 20.4. (Each is off by one.) Reproduce code: --------------- echo intval(100 * 10.2); Expected result: ---------------- 1020 Actual result: -------------- 1019 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34442&edit=1