[php-src] PR #12159: Fix #12123 Improve precision of rounding for large FP numbers
| From: | jorgsowa | Date: | Fri, 08 Sep 2023 21:58:35 +0000 |
| Subject: | [php-src] PR #12159: Fix #12123 Improve precision of rounding for large FP numbers | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23605@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12159
Author: jorgsowa
This PR fixes https://github.com/php/php-src/issues/12143
First issue is rounding for numbers large precision FP numbers for mode PHP_ROUND_HALF_UP.
Second issue is that we prereound numbers with too big precision. I decreased the range of precision
by 1, but I didn't check theoretically would range be the best. RFC modifying
round() function doesn't explain it comprehensively why such arbitrary values were
chosen (or maybe I just don't understand it). https://wiki.php.net/rfc/rounding