Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123472 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 82B211A009C for ; Fri, 31 May 2024 14:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717167038; bh=/618jtPijggnsKTgJcB7ogmrg9BguKunuV6JJSsdsGs=; h=From:Subject:Date:To:From; b=LqMR2GVOXhPcSlvgbUVi9mpzIGMqy1nMOSGDUMANN5Id9xbVGugm/ELXE+N84Gym8 4+cnUH7JJ6jQSmOvtSU16ktSNKnuZ1vwFhwppqWbfUDfcA40iQ+Bf7/5Lw4Cw56HNi HsFf6oJgmNW+cmSlDSjs6ZMRD8+NgB1OVZ8QLf4i0hGY9e/4cyuQnj+Q8yql/2V/dw Yl+If4zIXv13s+OYq/I3V84hGgZ/jmYTzhIbbI7mr4w7FJ9qvSjGExZpL6ZJKAZ6lG QZM9XnUKwACB9A0tnXZmcZcvPLuGIYY6vSsXyOaK6d57a6WWfiLJGppgiu5OEYOhlD QUH3f7JHsLX3Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A66C1805F4 for ; Fri, 31 May 2024 14:50:35 +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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) 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, 31 May 2024 14:50:34 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id C7F5F401D3 for ; Fri, 31 May 2024 23:49:28 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1717166968; bh=/618jtPijggnsKTgJcB7ogmrg9BguKunuV6JJSsdsGs=; h=From:Subject:Date:To:From; b=dKjGe2oRB8BY04VzL4Xw8RaLiOG40doVoBvL1iMlOP0+vHMMcfjKlEJbP/A6av3hN PifdaWitny7QuPB6G0uqAiansjpENAVYi+cZGnO3Usr4QU3yd6CWneQawgfHv5Yw5r DuUoKDmTIIThyNXdjFYWbPXL5+dGeyedk9x7N6jU= 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 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: [PHP-DEV] [RFC] [discussion] Correctly name the rounding mode and make it an Enum Message-ID: <81CBE5A8-9FAF-40DA-8EAB-9F19C2278E75@sakiot.com> Date: Fri, 31 May 2024 23:49:16 +0900 To: php internals X-Mailer: Apple Mail (2.3774.500.171.1.1) From: saki@sakiot.com (Saki Takamachi) Hi, internals! I would like to start an RFC discussion regarding rounding modes. = https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_e= num As mentioned previously by Gina on the mailing list [1], there are some = issues with PHP's current rounding mode. [1] - https://externals.io/message/123126 =E2=80=A2 First, the value is just an int, so we need to verify that = the value passed is a valid rounding mode. =E2=80=A2 The second problem is that the behavior of the =E2=80=9Cup=E2= =80=9D and =E2=80=9Cdown=E2=80=9D modes does not match the mathematical = definition. Especially for non-native speakers, the different rounding = modes might also be more easily confused, compared to a naming that uses = less abstract terms. To resolve these issues, change the naming to something appropriate and = use Enums instead of int constants. Please see the RFC for details. Regards, Saki=