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

From: Date: Fri, 31 May 2024 14:49:16 +0000
Subject: [RFC] [discussion] Correctly name the rounding mode and make it an Enum
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi, internals!

I would like to start an RFC discussion regarding rounding modes.
https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum

As mentioned previously by Gina on the mailing list [1], there are some issues with PHP's
current rounding mode.
[1] - https://externals.io/message/123126

    • First, the value is just an int, so we need to verify that the value passed is a valid
rounding mode.
    • The second problem is that the behavior of the “up” and “down” modes does not match
the mathematical definition. Especially for non-native speakers, the different rounding modes might
also be more easily confused, compared to a naming that uses less abstract terms.

To resolve these issues, change the naming to something appropriate and use Enums instead of int
constants.

Please see the RFC for details.

Regards,

Saki


Thread (27 messages)

« previous php.internals (#123472) next »