Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121614 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59545 invoked from network); 8 Nov 2023 02:22:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Nov 2023 02:22:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A57C1804D0 for ; Tue, 7 Nov 2023 18:22:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,MIME_QP_LONG_LINE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 7 Nov 2023 18:22:42 -0800 (PST) Received: from smtpclient.apple (55.150.159.133.rev.vmobile.jp [133.159.150.55]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id A74F8401D2; Wed, 8 Nov 2023 11:22:39 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1699410159; bh=huv1z+EA40YRRYp1O8fRqjbqu652ZLo+z7Y4h7+oUyk=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=eJvu4gmBLh7n6Nja0TdKjaeeyxliAhTsKmlkg7OCYA+MVcPIYSRabZhpTzqIWnqIj KsHKKKvUSJ++48fPJXG+CqsEqVJGQbjOUsKJGBT3f6OpRu7fu4zQOYAtzbHKFLSCug J7ZRvk2pI1wAChwy4GFdCSw18XDMxyvKcf6xtbLQ= Content-Type: multipart/alternative; boundary=Apple-Mail-E73DCDC5-31D6-4EF5-B1B1-6C70AE826F28 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) In-Reply-To: Cc: Michael Wallner , internals@lists.php.net Date: Wed, 8 Nov 2023 11:22:27 +0900 Message-ID: References: To: Jakub Zelenka X-Mailer: iPhone Mail (21A360) Subject: Re: [PHP-DEV] [RFC] [Discussion] Change the edge case of round() From: saki@sakiot.com (Saki Takamachi) --Apple-Mail-E73DCDC5-31D6-4EF5-B1B1-6C70AE826F28 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Hi Jakub, > please do not top post - you might want to check these rules for PHP maili= ng 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 dec= imal edge cases. It says:=20 >=20 > > Of course, one may argue that pre-rounding is not necessary and that thi= s is simply the problem with FP arithmetics. This is true on the one hand, b= ut 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 >=20 > 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 imp= lementation 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 w= hich 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= --Apple-Mail-E73DCDC5-31D6-4EF5-B1B1-6C70AE826F28--