Bug #79338 [NEW]: fmod() not calculating properly
| From: | ziggi at ziggi dot pl | Date: | Tue, 03 Mar 2020 11:20:41 +0000 |
| Subject: | Bug #79338 [NEW]: fmod() not calculating properly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225863@lists.php.net to get a copy of this message | ||
From: ziggi at ziggi dot pl
Operating system: Windows
PHP version: 7.4.3
Package: *Math Functions
Bug Type: Bug
Bug description:fmod() not calculating properly
Description:
------------
---
From manual page: https://php.net/function.fmod
---
I would say - simple answer provided by PHP team:
"The value that you expect (0) is obtained using float precision. (In
C)
PHP uses double, and with this type fmod() returns 1.3."
I completely pointless. This is not math! This is plain bullshit!!!
Perl, MySQL, Python... you name it, all have no problems!!!
Test script:
---------------
echo fmod(75.6, 25.2);
Expected result:
----------------
0
Actual result:
--------------
25.2
--
Edit bug report at https://bugs.php.net/bug.php?id=79338&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79338&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79338&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79338&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79338&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79338&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79338&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79338&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79338&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79338&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79338&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79338&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79338&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79338&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79338&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79338&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79338&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79338&r=mysqlcfg