ID: 44255 Updated by: [EMAIL PROTECTED] Reported By: php at jelmer dot cc -Status: Open +Status: Feedback Bug Type: Math related Operating System: Linux PHP Version: 5.2.5 New Comment:
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. I have not been able to reproduce your code. PHP 5.2.5 Linux Previous Comments: ------------------------------------------------------------------------ [2008-02-26 17:58:53] php at jelmer dot cc Description: ------------ Linux version 2.6.22-3-686 (Debian 2.6.22-6) ([EMAIL PROTECTED]) (gcc version 4.1.3 20071019 (prerelease) (Debian 4.1.2-17)) #1 SMP Mon Nov 12 08:32:57 UTC 2007 PHP (PHP 5.2.5-2 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 1 2008 21:17:20)) returns a rather strange result for a certain mathematical expression. Also, the weird result is only returned in very specific cases: php> = (0.005 + 0.002/3 + 0.194 + 0.001/3 )/2 0.0: (notice the semicolon!) php> = (0.004 + 0.002/3 + 0.195 + 0.001/3 )/2 0.1 php> = (0.005 + 0.194 + 0.002/3 + 0.001/3 )/2 0.1 When $result is the 'strange' result: is_float($result) == true is_float(0.0:) ==> syntax error Needless to say the strange result is resulting in syntax-errors in the code where it occurs. Reproduce code: --------------- print (0.005 + 0.002/3 + 0.194 + 0.001/3 )/2 Expected result: ---------------- I'd expect: 0.1 Actual result: -------------- I'm getting: 0.0: (notice the ':') ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44255&edit=1
