ID: 30614 Updated by: [EMAIL PROTECTED] Reported By: mauricio at elmaster dot com -Status: Open +Status: Bogus Bug Type: Reproducible crash Operating System: Linux 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. Previous Comments: ------------------------------------------------------------------------ [2004-10-29 19:21:18] mauricio at elmaster dot com Description: ------------ This simple operation fails. We have tried it on PHP 4.3.4 standard install on fedora Core 2, and PHP 5.0.1. Instead of 0 we get 1-8.8817841970013E-16. If we change a bit the number the code doesn't fails, very weird. Reproduce code: --------------- <?php die(9.95 + 4.97 - 9.95 - 4.97); ?> Expected result: ---------------- 0 Actual result: -------------- 1-8.8817841970013E-16 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30614&edit=1