On Thu, Oct 12, 2023 at 11:24 AM Jordan LeDoux <jordan.led...@gmail.com> wrote:
> > > On Thu, Oct 5, 2023 at 5:27 AM Saki Takamachi <s...@sakiot.com> wrote: > >> Hi, Pierre >> >> In fact, I predict that many use cases will be covered by GMP. >> >> Still, I think that there may be cases where calculation functions like >> mainframe BCD are required, such as when calculating money. >> >> I am unable to decide whether it is correct to deprecate BCMath and only >> use GMP. >> >> I'd like to hear other people's opinions as well. >> >> Regards. >> >> Saki >> > > GMP cannot be used in any reasonable way to implement things like sin() or > cos(). It is *technically* possible, but not at all reasonable. Now, PHP > doesn't natively support trig functions for anything other than normal > floats, but things like that are exactly the extended capability that my > PHP math library adds. This is required for most statistics, which now HAVE > to be done in PHP itself since the ext-stats extension hasn't been updated > since... I think 7.1? > > BCMath is one of the worst and slowest implementations of arbitrary > precision decimals. It absolutely should be replaced. I have explored > creating a new extension to do just this in fact for the express purpose of > deprecating and replacing the bundled BCMath. But GMP, as it is implemented > currently, is not a replacement at all. > > Jordan > Take a look at the ext-decimal extension if you are interested in replacing BCMath. It honestly is almost a drop-in replacement. Jordan