Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124408 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 45A121A00B7 for ; Fri, 12 Jul 2024 11:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720785052; bh=Stwe4bn4ZfXNDoA5X7xWoW1xlJqUjIkwIhvPvVZUhFw=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=W2d3kL2k6nd4L/p3eY76SbqWbhudbob5JMu5J/YPvU8CvODdaAvb8NfIOwYmMGdlu N67xKL9PptFS1qy3R16Vw1pFvHU/2FF+7Du918OBqeW+PUecaswTUPnr2UsQhN+BtI Q7vcbTbIuREfOxie1D7MaDjCzBdv8w/6nAmU0fL3wKU54mLzU2pG4J33p5psLXZdjz QQIjeCrBxXQrrnCd4ZNpOEaDlz64AqVj4d7mrdf1jWq+CQRcETjnz7GWJ/Lk1NAQ7P W2TFHjd0tMrluuWMazLH9pGrtHaAZloKn4GBV5H7qsbnpFzApkAQJXT8ncvW3kTz6S nQHlwz3SyJrOw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A13AF180069 for ; Fri, 12 Jul 2024 11:50:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 12 Jul 2024 11:50:50 +0000 (UTC) Received: from smtpclient.apple (218.152.159.133.rev.vmobile.jp [133.159.152.218]) (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 0376D401E4; Fri, 12 Jul 2024 20:49:20 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1720784960; bh=Stwe4bn4ZfXNDoA5X7xWoW1xlJqUjIkwIhvPvVZUhFw=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=rWWGN2sCL4nM/qZ/Dd+TUes5ZeIk/sjcUUP5QQ7B2gXtd2oaD6CjC60cfPLr7aVFo cmUhIKcw5cyPAfVBk3w6yc5iHKdVQZsX+r8ASvCYPkAbvMKraZTIpWIyp2NFluUzRu 1mAECrWAZc+RRjpWOwJbMI2gCYhtci1cgVkCDJe8= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] Breaking change of rounding behavior in PHP 8.4 In-Reply-To: Cc: PHP Internals Date: Fri, 12 Jul 2024 20:49:06 +0900 Message-ID: References: To: "Christoph M. Becker" X-Mailer: iPhone Mail (21F90) From: saki@sakiot.com (Saki Takamachi) Hi Christoph, > =EF=BB=BFHi all, >=20 > there has been a "small" change in the rounding logic of > _php_math_round()[1] a couple of months ago. A respective ticket, > claiming the new behavior would be a bug[2] had been filed a while ago > without proper triage so far. I'm bringing this to your attention, > because I'm afraid that there will be (many) more bug reports about this > in the future (note that the change only affects master, and only PHP > 8.4.0alpha1 has been released yet, so it is probably not widespreadly > tested yet). At the very least we should be sure that we want to keep > this change, and document it well, to avoid discussions in every filed > ticket. >=20 > My personal stance on this is simple: floating point arithmetic is not > exact per se, and changes to how PHP handles the details should only be > introduced, if they clearly improve things. This change apparently > improves some cases, but worsens others. Thus, I think the change > should better be reverted, and if at all, postponed to PHP 9, since I > neither regard this change as bug fix nor as a feature. >=20 > What do you think? >=20 > [1] > [2] >=20 > Cheers, > Christoph As you know, I am the implementer of that change. At the time, I thought "just add another digit," but this may have been a mo= re disruptive change than I realized. I'm not opposed to reverting this, but I don't have any strong opinions on w= hether it should be reverted. I'd like to hear other people's opinions as well. Regards, Saki=