Re: [RFC] [Discussion] Change the edge case of round()

From: Date: Wed, 08 Nov 2023 02:22:27 +0000
Subject: Re: [RFC] [Discussion] Change the edge case of round()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-121614@lists.php.net to get a copy of this message
Hi Jakub, > please do not top post - you might want to check these rules for PHP mailing lists: > https://github.com/php/php-src/blob/master/docs/mailinglist-rules.md > if you haven't seen them already ;) I intended to post with all the quotes deleted, but it seems I was wrong. > It would be good to also mention original reasoning for preferring the decimal edge cases. It > says: > > > Of course, one may argue that pre-rounding is not necessary and that this is simply the > > problem with FP arithmetics. This is true on the one hand, but the introduction of the places > > parameter made it clear that round() is to operate as if the numbers were stored as decimals. We > > can't revert that and this seems to me to be the best solutions for FP numbers one can get > > I think it's got a good point with the second parameter and it's something that > voters should consider. You should not probably say that's current implementation is wrong. It > just chose to prefer decimal format and address the edge cases explicitly in a way that it makes > more sense to users. Obviously it didn't fix all issues but we can potentially continue in that > approach which is what you did in one of your PR's - it would be good to probably also note > that such implementation is more complex. Ok, I'll fix the RFC. thank you for the advice. Regards. Saki

« previous php.internals (#121614) next »