Re: [RFC] [discussion] Correctly name the rounding mode and make it an Enum

From: Date: Fri, 31 May 2024 16:41:48 +0000
Subject: Re: [RFC] [discussion] Correctly name the rounding mode and make it an Enum
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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)

« previous php.internals (#123476) next »