Bug #80973 [NEW]: round() fail if ini 'precision' value > 16
| From: | pavlusha23 at gmail dot com | Date: | Wed, 21 Apr 2021 02:55:53 +0000 |
| Subject: | Bug #80973 [NEW]: round() fail if ini 'precision' value > 16 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233533@lists.php.net to get a copy of this message | ||
From: pavlusha23 at gmail dot com
Operating system: Linux
PHP version: 8.0.3
Package: *Math Functions
Bug Type: Bug
Bug description:round() fail if ini 'precision' value > 16
Description:
------------
round() function fail if ini 'precision' value > 16
Test script:
---------------
<?php
// Default ini value
ini_set('precision','14');
echo round(23.879999999999999, 2)."\n";
ini_set('precision','16');
echo round(23.879999999999999, 2)."\n";
ini_set('precision','17');
echo round(23.879999999999999, 2);
Expected result:
----------------
23.88
23.88
23.88
Actual result:
--------------
23.88
23.88
23.879999999999999
--
Edit bug report at https://bugs.php.net/bug.php?id=80973&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80973&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80973&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80973&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80973&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80973&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80973&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80973&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80973&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80973&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80973&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80973&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80973&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80973&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80973&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80973&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80973&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80973&r=mysqlcfg