Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Jordan LeDoux
On Tue, Dec 12, 2023 at 4:29 PM Jordan LeDoux wrote: > > > On Tue, Dec 12, 2023 at 3:05 PM Erick de Azevedo Lima < > ericklima.c...@gmail.com> wrote: > >> Oh, I just realized that I used the wrong word, so let me rephrase that: >> >> What's the name of the library you're talking about? Maybe the

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Jordan LeDoux
On Tue, Dec 12, 2023 at 3:05 PM Erick de Azevedo Lima < ericklima.c...@gmail.com> wrote: > Oh, I just realized that I used the wrong word, so let me rephrase that: > > What's the name of the library you're talking about? Maybe the *pros* of a > core implementation can be highlighted if we can see

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Erick de Azevedo Lima
Oh, I just realized that I used the wrong word, so let me rephrase that: What's the name of the library you're talking about? Maybe the *pros* of a core implementation can be highlighted if we can see the limitations of a user-land approach. Best, Erick Em ter., 12 de dez. de 2023 às 18:52, Eric

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Erick de Azevedo Lima
Hi Jordan. What's the name of the library you're talking about? Maybe the cons of a core implementation can be highlighted if we can see the limitations of a user-land approach. Best, Erick Em ter., 12 de dez. de 2023 às 18:35, Jordan LeDoux escreveu: > On Tue, Dec 12, 2023 at 1:26 PM Larry Ga

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Jordan LeDoux
On Tue, Dec 12, 2023 at 1:26 PM Larry Garfield wrote: > On Tue, Dec 12, 2023, at 1:03 PM, G. P. B. wrote: > > > The issue is that I don't think having arbitrary precision decimals as a > > core language feature is a necessity compared to rational types. > > A cast from rational to float wouldn't

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Jordan LeDoux
On Tue, Dec 12, 2023 at 1:00 PM Robert Landers wrote: > > Hey Gina, > > > GMP supports operator overloading > > GMP kinda-sorta-most-of-the-time supports operator overloading. > Sometimes ... it doesn't. I implemented a field library in PHP (for > work a couple of years ago) and occasionally, ove

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Larry Garfield
On Tue, Dec 12, 2023, at 1:03 PM, G. P. B. wrote: > The issue is that I don't think having arbitrary precision decimals as a > core language feature is a necessity compared to rational types. > A cast from rational to float wouldn't produce a large round trip, whereas > trying to figure out arbitr

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Robert Landers
On Tue, Dec 12, 2023 at 2:04 PM G. P. B. wrote: > > On Fri, 8 Dec 2023 at 10:14, Alexander Pravdin > wrote: > > > On Thu, Dec 7, 2023 at 11:36 PM G. P. B. wrote: > > > > - Objects are always casted to true, GMP(0) will equal to true. > >>> > >> > >> This is incorrect, GMP object do _not_ support

Re: [PHP-DEV] Re: Proposal: Arbitrary precision native scalar type

2023-12-12 Thread G. P. B.
Gina P. Banyard On Tue, 12 Dec 2023 at 08:51, Alexander Pravdin wrote: > I just found out that under PHP 8.3, basic arithmetic operations on the > Decimal object variables are no longer supported and cause TypeError. So > this is one more point to implementing native decimals in PHP. > This is

Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2023-12-12 Thread G. P. B.
On Fri, 8 Dec 2023 at 10:14, Alexander Pravdin wrote: > On Thu, Dec 7, 2023 at 11:36 PM G. P. B. wrote: > > - Objects are always casted to true, GMP(0) will equal to true. >>> >> >> This is incorrect, GMP object do _not_ support casts to bool >> See https://3v4l.org/LHpD1 >> > > This is weird. A

[PHP-DEV] Re: Proposal: Arbitrary precision native scalar type

2023-12-12 Thread Alexander Pravdin
On Thu, Dec 7, 2023 at 3:36 PM Alex Pravdin wrote: Ext-decimal: > ... > - Workaround: implements the Decimal class that allows basic regular math > operations. > I just found out that under PHP 8.3, basic arithmetic operations on the Decimal object variables are no longer supported and cause Typ