Bug #70559 [NEW]: subtraction float numbers bug

From: Date: Wed, 23 Sep 2015 11:11:45 +0000
Subject: Bug #70559 [NEW]: subtraction float numbers bug
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196182@lists.php.net to get a copy of this message
From: jakub dot trzcinski at valueadd dot pl Operating system: Windows And Linux PHP version: 5.6.13 Package: Math related Bug Type: Bug Bug description:subtraction float numbers bug Description: ------------ it's doesnt matter which is type(int/float) of seccond value, its always bad result. Test script: --------------- $a = 217.80; $b = 217; echo $a - $b; ------------------------ $a = 217.80; $b = 217.00; echo $a - $b; Expected result: ---------------- 0.8 Actual result: -------------- 0.80000000000001 -- Edit bug report at https://bugs.php.net/bug.php?id=70559&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70559&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70559&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70559&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70559&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70559&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70559&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70559&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70559&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70559&r=support Expected behavior: https://bugs.php.net/fix.php?id=70559&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70559&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70559&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70559&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70559&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70559&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70559&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70559&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70559&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70559&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70559&r=mysqlcfg

« previous php.bugs (#196182) next »