Re: [RFC] [discussion] Correctly name the rounding mode and make it an Enum
Hey Saki,
I like this change. When I was implementing additional rounding modes for
the next PHP version I was initially struggling with the naming and this
change will be helpful.
I have only one concern about the names NegativeInfinity
and
PositiveInfinity
. They may be too formal from the user's perspective. As
we already have functions ceil
and floor
it's more intuitive for
developers to understand the logic of ceiling and floor rounding.
But if voters will prefer those terms then it makes sense to change the
constants implemented in PHP 8.4 (and thus not released yet) from
PHP_ROUND_(CEILING|FLOOR)
to
PHP_ROUND_(POSITIVE_INFINITY|NEGATIVE_INFINITY)
for the sake of
consistency.
Kind regards,
Jorg
Thread (27 messages)