From: spam at michaelburri dot ch Operating system: OS X 10.8.2 (12C3012) PHP version: 5.4Git-2013-03-04 (Git) Package: Math related Bug Type: Bug Bug description:fmod returning wrong values for negative dividends
Description: ------------ The fmod(dividend, divisor) function returns wrong values for negative dividends that are smaller than the divisor. For example -0.8 mod 6 => -1 * 6 + 5.2, so the result of the modulo (= remainder) is 5.2. Test script: --------------- <?php echo fmod(-0.8, 6); //Should return 5.2, but returns -0.8 ?> Expected result: ---------------- 5.2 Actual result: -------------- -0.8 -- Edit bug report at https://bugs.php.net/bug.php?id=64350&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64350&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64350&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64350&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64350&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64350&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64350&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64350&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64350&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64350&r=support Expected behavior: https://bugs.php.net/fix.php?id=64350&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64350&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64350&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64350&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64350&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64350&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64350&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64350&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64350&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64350&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64350&r=mysqlcfg