[Round] Change the edge case of Round()
| From: | Saki Takamachi | Date: | Fri, 13 Oct 2023 09:59:55 +0000 |
| Subject: | [Round] Change the edge case of Round() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-121297@lists.php.net to get a copy of this message | ||
Hi, internals
I'm working on fixing a bug in
round(). There was a discussion about what should
be considered an edge case.
For example, 0.285 is internally 0.28499999999999998. Should this be
considered an edge case? Or is it not an edge case? Regarding this issue, in 2008, the following RFC
adopted the policy that 0.285 is considered an edge case''.
https://wiki.php.net/rfc/rounding
Here is a PR for changes based on the contents of the above RFC.
https://github.com/php/php-src/pull/12268
However, since FP is just FP, there is an opinion that it is wrong to treat 0.285 as an
edge case. This is PR based on such opinions.
https://github.com/php/php-src/pull/12291
A new RFC is required to change what was determined in the previous RFC, so I would like to hear
everyone's opinions first.
Best regards.
Saki