Re: [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath
| From: | Marc | Date: | Tue, 03 Oct 2023 09:55:22 +0000 |
| Subject: | Re: [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121215@lists.php.net to get a copy of this message | ||
Hi,
On 03.10.23 00:48, Jorg Sowa wrote:
Hello, Recently I was trying to fix and clean some of the stuff within the BCmath extension along with Girgias who helped me. I wanted to enrich this extension with similar functions that GMP contains and improve the performance, however, I went to some conclusions and stopped it. 1. BCMath extension isn't fast enough compared to other existing arbitrary precision PHP extensions. Comparison: https://php-decimal.github.io/#performance 2. BCMath doesn't have OO API and thus it may break the backward compatibility as Claude noticed. 3. GMP GNU library provides support for float numbers, however, its functionality is not exposed in the PHP extension. And BCMath doesn't provide as many functions as GMP.There was an RFC back in 2014 from Sara : https://wiki.php.net/rfc/gmp-floating-point (never put to vote) and another one from 2013 : https://wiki.php.net/rfc/gmp_number (never put to vote). Also I think to remember about a proposal to have GMP natively supported for numbers in PHP but I can't find it anymore.
Kind regards, JorgBest, Marc