Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Saki Takamachi
Should we use MPFR for new mathematics? I'm not very familiar with it, but am I correct in understanding that this can definitely represent a decimal number correctly, albeit a floating point number? Regards. Saki -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: ht

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Saki Takamachi
Hi, Jordan Thank you, that was an easy to understand explanation. I would agree with that, if it means creating new math features that aren't currently bundled, rather than unifying them with GMP. How far along is this plan now? I'm very interested in that. Regards. Saki -- PHP Internals - PH

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Hans Henrik Bergan
been years since i checked, but last time i checked, BCMath supports floating point numbers, and PHP's GMP wrappers does not (this is not a limitation of GMP itself, but of PHP's GMP wrappers) - has the GMP api floating issues been fixed? a quick test suggest /no/: https://3v4l.org/FQaI4 On Thu,

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Pierre Joye
On Fri, Oct 13, 2023, 2:01 AM Jordan LeDoux wrote: > > > > I believe MPFR is what is used by ext-decimal. The only thing that makes > ext-decimal a somewhat difficult replacement for BCMath is that one of them > uses precision and the other uses scale. (Total accurate digits versus > total signif

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Jordan LeDoux
On Thu, Oct 12, 2023 at 11:32 AM Pierre Joye wrote: > Hi Jordan > > On Fri, Oct 13, 2023, 1:24 AM Jordan LeDoux > wrote: > >> >> >> On Thu, Oct 5, 2023 at 5:27 AM Saki Takamachi wrote: >> >>> Hi, Pierre >>> >>> In fact, I predict that many use cases will be covered by GMP. >>> >>> Still, I thin

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Pierre Joye
Hi Jordan On Fri, Oct 13, 2023, 1:24 AM Jordan LeDoux wrote: > > > On Thu, Oct 5, 2023 at 5:27 AM Saki Takamachi 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

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Jordan LeDoux
On Thu, Oct 12, 2023 at 11:24 AM Jordan LeDoux wrote: > > > On Thu, Oct 5, 2023 at 5:27 AM Saki Takamachi 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

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Jordan LeDoux
On Thu, Oct 5, 2023 at 5:27 AM Saki Takamachi 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

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-06 Thread Saki Takamachi
Hi, Claude I'm very sorry, I'm not a native English speaker and I couldn't quite understand whether you think BCMath should be integrated into GMP. I understand your use case well, so if you don't mind, can I ask if it should or should not be integrated? Regards. Saki -- PHP Internals - PHP R

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-06 Thread Saki Takamachi
Hi, Jeff Thanks for letting me know your use case. This is important information when discussing this issue. Saki -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-06 Thread Claude Pache
Hi, > Le 5 oct. 2023 à 14:26, Saki Takamachi a écrit : > > 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 whethe

RE: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-05 Thread Jeffrey Dafoe
> -Original Message- > Still, I think that there may be cases where calculation functions like > mainframe > BCD are required, such as when calculating money. We use BCMath for money calculations. -Jeff -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-05 Thread Saki Takamachi
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 l

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-04 Thread Pierre Joye
Hi On Wed, Oct 4, 2023, 6:39 PM Saki Takamachi wrote: > Hi, Marc, Pierre > > Thank you for all the information. > > After all, I feel that BCMath and GMP have different roles. > > Arbitrary precision mathematics and very high precision mathematics are > similar but distinctly different. > I rep

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-04 Thread Saki Takamachi
Hi, Marc, Pierre Thank you for all the information. After all, I feel that BCMath and GMP have different roles. Arbitrary precision mathematics and very high precision mathematics are similar but distinctly different. If PHP has already started integrating these things, then of course I'll fol

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-03 Thread Pierre Joye
On Tue, Oct 3, 2023, 4:13 PM Saki Takamachi wrote: > yes, they do, as do almost all floating points implementation. > > Memory limited float values and their respective operations are still > useful in many areas, but financial values and the likes. Scaled integers > are the way for accuracy. > >

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-03 Thread Marc
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 c

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-03 Thread Saki Takamachi
> yes, they do, as do almost all floating points implementation. > > Memory limited float values and their respective operations are still useful > in many areas, but financial values and the likes. Scaled integers are the > way for accuracy. > > > Also, side note, gmp recommends to rely on

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-03 Thread Pierre Joye
On Tue, Oct 3, 2023, 12:25 PM Saki Takamachi wrote: > > I thought GMP was a function for integers, so I wasn't expecting that tbh. > > However, even if GMP supported floating point numbers, wouldn't it end up > having the inherent error problem of floating point numbers? > yes, they do, as do al

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-02 Thread Saki Takamachi
Hi, Claude, Jorg > If the existence of the function is checked in advance, the BC risk is worst, > because they cannot have known whether the signature and semantics of the > function you will introduce will be compatible with the one they have > defined. In case of mismatch the eventual breaka

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-02 Thread Jorg Sowa
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 exten

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-02 Thread Claude Pache
> Le 1 oct. 2023 à 14:35, Saki Takamachi a écrit : > > Hi, internals > > I would like to start the discussion for my RFC "Adding bcround, bcfloor and > bcceil to BCMath”. > https://wiki.php.net/rfc/adding_bcround_bcfloor_bcceil_to_bcmath > > Regards. > > Saki > -- > PHP Internals - PHP Runt

[PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-01 Thread Saki Takamachi
Hi, internals I would like to start the discussion for my RFC "Adding bcround, bcfloor and bcceil to BCMath”. https://wiki.php.net/rfc/adding_bcround_bcfloor_bcceil_to_bcmath Regards. Saki -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.p