[RFC] [Discussion] Fix up BCMath Number Class / Change GMP bool cast behavior

php.internals

Saki Takamachi

2 years ago
Hi internals, Created a follow-up RFC for the BCMath\Number class. This RFC also contains proposed changes to GMP's bool cast. I have proposed similar changes to BCMath, so for procedural efficiency I have combined them into the same RFC. Note that although they are combined into one RFC, these votes are taken independently. https://wiki.php.net/rfc/fix_up_bcmath_number_class Regards, Saki

Saki Takamachi

2 years ago
Hi all,
> Hi internals, > > Created a follow-up RFC for the BCMath\Number class. This RFC also contains proposed changes to GMP's bool cast. I have proposed similar changes to BCMath, so for procedural efficiency I have combined them into the same RFC. > > Note that although they are combined into one RFC, these votes are taken independently. > > https://wiki.php.net/rfc/fix_up_bcmath_number_class > > Regards, > > Saki
Added changes to RFC. It is a proposal to remove all rounding during calculations due to convenience issues and the fact that the functionality is "excessive" to begin with. To be precise, it will have the same truncation behavior as the existing BCMath function, making it impossible for users to change this behavior during calculations. If the user wants to perform rounding, they must always use the `round()` method. Regards, Saki

Saki Takamachi

2 years ago
> Added changes to RFC. It is a proposal to remove all rounding during calculations due to convenience issues and the fact that the functionality is "excessive" to begin with. > > To be precise, it will have the same truncation behavior as the existing BCMath function, making it impossible for users to change this behavior during calculations. If the user wants to perform rounding, they must always use the `round()` method. > > Regards, > > Saki
I also mentioned making the class serializable. Regards, Saki

Jordan LeDoux

2 years ago
On Tue, Jul 2, 2024 at 4:06 AM Saki Takamachi <saki@sakiot.com> wrote:
> Hi all, > > > Hi internals, > > > > Created a follow-up RFC for the BCMath\Number class. This RFC also > contains proposed changes to GMP's bool cast. I have proposed similar > changes to BCMath, so for procedural efficiency I have combined them into > the same RFC. > > > > Note that although they are combined into one RFC, these votes are taken > independently. > > > > https://wiki.php.net/rfc/fix_up_bcmath_number_class > > > > Regards, > > > > Saki > > > Added changes to RFC. It is a proposal to remove all rounding during > calculations due to convenience issues and the fact that the functionality > is "excessive" to begin with. > > To be precise, it will have the same truncation behavior as the existing > BCMath function, making it impossible for users to change this behavior > during calculations. If the user wants to perform rounding, they must > always use the `round()` method. > > Regards, > > Saki
This seems positive to me. Rounding being explicit makes more sense. Jordan

Saki Takamachi

2 years ago
> This seems positive to me. Rounding being explicit makes more sense.
Thanks! Saki

Saki Takamachi

2 years ago
Hi all,
> Hi internals, > > Created a follow-up RFC for the BCMath\Number class. This RFC also contains proposed changes to GMP's bool cast. I have proposed similar changes to BCMath, so for procedural efficiency I have combined them into the same RFC. > > Note that although they are combined into one RFC, these votes are taken independently. > > https://wiki.php.net/rfc/fix_up_bcmath_number_class > > Regards, > > Saki
Barring any further discussion, I plan to open the vote on 7/15. Regards, Saki

Tim Düsterhus

2 years ago
Hi On 6/30/24 17:03, Saki Takamachi wrote:
> Created a follow-up RFC for the BCMath\Number class. This RFC also contains proposed changes to GMP's bool cast. I have proposed similar changes to BCMath, so for procedural efficiency I have combined them into the same RFC. > > Note that although they are combined into one RFC, these votes are taken independently. > > https://wiki.php.net/rfc/fix_up_bcmath_number_class
Thank you. As one of the persons who had concerns about the API introduced in the first RFC all these changes make sense to me and clearly improve the API. I'll happily vote in favor of both votes. Best regards Tim Düsterhus

Saki Takamachi

2 years ago
Hi, Tim
> Thank you. As one of the persons who had concerns about the API introduced in the first RFC all these changes make sense to me and clearly improve the API. I'll happily vote in favor of both votes.
I'm glad that your concerns seem to have been resolved. I feel the API has definitely been improved, thank you! Saki

Saki Takamachi

2 years ago
Hi all,
> Hi internals, > > Created a follow-up RFC for the BCMath\Number class. This RFC also contains proposed changes to GMP's bool cast. I have proposed similar changes to BCMath, so for procedural efficiency I have combined them into the same RFC. > > Note that although they are combined into one RFC, these votes are taken independently. > > https://wiki.php.net/rfc/fix_up_bcmath_number_class > > Regards, > > Saki
Added one more change to the RFC. Currently, there is no other expression for comparison in PHP called "comp”. The expression "cmp" is mainly used for functions, and the expression "compare" is used for class methods. e.g. https://www.php.net/manual/ja/splpriorityqueue.compare.php https://www.php.net/manual/ja/collator.compare.php Therefore, follow these conventions and rename `comp()` to `compare()`. Regards, Saki

Gina P. Banyard

2 years ago
On Wednesday, 10 July 2024 at 07:35, Saki Takamachi <saki@sakiot.com> wrote:
> Added one more change to the RFC. > > Currently, there is no other expression for comparison in PHP called "comp”. The expression "cmp" is mainly used for functions, and the expression "compare" is used for class methods. > > e.g. > https://www.php.net/manual/ja/splpriorityqueue.compare.php > https://www.php.net/manual/ja/collator.compare.php > > Therefore, follow these conventions and rename `comp()` to `compare()`.
Thank you, I am happy will all the provided amendments now! Best regards, Gina P. Banyard

Saki Takamachi

2 years ago
Hi Gina,
> Thank you, I am happy will all the provided amendments now! > > Best regards, > > Gina P. Banyard
Thank you! All the issues mentioned have now been resolved and the vote is expected to go ahead as scheduled. Regards, Saki