Reimplement `php_round_helper()` using `modf()` (#12220) This change makes the implementation much easier to understand, by explicitly handling the various cases. It fixes round
Reimplement `php_round_helper()` using `modf()` (#12220) This change makes the implementation much easier to understand, by explicitly handling the various cases. It fixes rounding for `0.49999999999999994`, because no loss of precision happens by adding / subtracing `0.5` before turning the result into an integral float. Instead the fractional parts are explicitly compared. see GH-12143 (this fixes one of the reported cases) Closes GH-12159 which was an alternative attempt to fix the rounding issue for `0.49999999999999994`
show more ...
|