Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-08 Thread Alexandru Pătrănescu
On Thu, Sep 7, 2023 at 11:10 PM Jordan LeDoux wrote: > > As someone who maintains a math library in PHP that has its own expanded > rounding implementation, I will politely disagree. Away from zero, towards > zero, towards positive infinity, and towards negative infinity are > completely and utte

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-07 Thread Jordan LeDoux
On Sun, Sep 3, 2023 at 5:51 AM Alexandru Pătrănescu wrote: > Hi! > > On Sun, Sep 3, 2023 at 3:14 PM Tim Düsterhus wrote: > > > > > The RFC mentions already has a section with regard to naming: > > > > > Why not the names PHP_ROUND_UP and PHP_ROUND_DOWN > > > > I generally agree with the argumen

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-06 Thread Tim Düsterhus
Hi On 9/5/23 00:34, Jorg Sowa wrote: Introducing a brand-new RoundingMode enum (using union types) I suggested in my first email would nicely solve the naming problem and would also make the API more obvious to use due to stronger typing in the long run. That's also interesting idea and I woul

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-04 Thread Jorg Sowa
Thank you all for the comments. The naming brought some constructive discussion. My preferred solution would be inconsistent PHP_ROUND_AWAY_FROM_ZERO and PHP_ROUND_TOWARD_ZERO as those are friendlier to the most of developers and are not possible to mistake with other modes. I would go even one st

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-04 Thread Tim Düsterhus
Hi On 9/3/23 17:50, Alexandru Pătrănescu wrote: I believe consistency is important and using UP for "away from zero" and DOWN for "towards zero" sounds good to me. That was so far used consistently everywhere, as far as I'm aware. Documentation is very clear about what they mean, and you can alw

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-03 Thread Alexandru Pătrănescu
Hi! On Sun, Sep 3, 2023 at 3:14 PM Tim Düsterhus wrote: > > The RFC mentions already has a section with regard to naming: > > > Why not the names PHP_ROUND_UP and PHP_ROUND_DOWN > > I generally agree with the argument in favor of the names you've chosen. > However they are inconsistent with the

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-03 Thread Tim Düsterhus
Hi On 9/2/23 21:33, Jorg Sowa wrote: RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function The RFC mentions already has a section with regard to naming: > Why not the names PHP_ROUND_UP and PHP_ROUND_DOWN I generally agree with the argument in favor of the names you've chosen.

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-03 Thread Tim Düsterhus
Hi On 9/2/23 21:33, Jorg Sowa wrote: I would like to start the RFC process about adding 4 new rounding modes to the round() function. As the topic was previously discussed and the change is quite small, I would like to start the voting on the beginning of next week. RFC: https://wiki.php.net/r

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-02 Thread Niels Dossche
Hey Jorg Thanks for your RFC. On 9/2/23 21:33, Jorg Sowa wrote: > Hello everyone, > > I would like to start the RFC process about adding 4 new rounding modes to > the round() function. > > As the topic was previously discussed and the change is quite small, I > would like to start the voting on

[PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-02 Thread Jorg Sowa
Hello everyone, I would like to start the RFC process about adding 4 new rounding modes to the round() function. As the topic was previously discussed and the change is quite small, I would like to start the voting on the beginning of next week. RFC: https://wiki.php.net/rfc/new_rounding_modes_t