Re: Introducing 2 new modes to round function
| From: | Jorg Sowa | Date: | Fri, 21 Jul 2023 22:48:20 +0000 |
| Subject: | Re: Introducing 2 new modes to round function | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120861@lists.php.net to get a copy of this message | ||
Thank you for your suggestions. I added two remaining modes and I think
it's complete now.
I changed the names to
PHP_ROUND_CEILING and PHP_ROUND_FLOOR to be
consisted with rounding modes in number_format() function. I'm not sure
about PHP_TOWARD_ZERO and 'PHP_AWAY_FROM_ZERO` as in there it's
ROUND_DOWN and ROUND_UP, which I also find too vague.
However, I could find names UP and DOWN in other documentations. And sadly
it refers to away from zero and toward zero, so there is big mismatch in
existing naming.
https://developer.apple.com/documentation/foundation/numberformatter/roundingmode/down
https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/math/RoundingMode.html
Kind regards,
Jorg
<https://developer.apple.com/documentation/foundation/numberformatter/roundingmode/down>