[php-src] PR #11641: Fix performance for Bcmath numbers with trailing zeros
| From: | jorgsowa | Date: | Sat, 08 Jul 2023 20:15:56 +0000 |
| Subject: | [php-src] PR #11641: Fix performance for Bcmath numbers with trailing zeros | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22960@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11641
Author: jorgsowa
This PR improves the performance of the BC extension computations for the decimal numbers with
trailing zeros. Specifically we get Memory limit error while we want to raise zero with many
trailing zeros to large exponent. Example: https://onlinephp.io/c/dcd86
Also it may improve other special cases of the math operations with number zero, like multiplying
with number zero.
Changes made:
- while we transform the number from string to bc_num we strip of the trailing zeros lower the
scale.