Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123485 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 E4B3D1A009C for ; Sat, 1 Jun 2024 05:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717219606; bh=jwPbJUMJ/zGQ0t8GL2PotnbFSnWm2CvvZXJvlnQkeL8=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=V5VNMC2AUqKF/P3Fde/MS5PoSOGtfB/AxQ3mAo+7MPOOPC8X7Hh7uQGXixS5hh9cu HmqTti9Np5NmwHI5aK6Vjxj16iGxic3ZH2SbkpGMoCmVvYFSFB3c3X1hIMgZ/52vam 1yIfB3C2klsruw7T+QKYX9pUp14uSgR0qLUfdhec7KK6q0iP+LhIMNAeKWoX3Ax+AR bGFqIjUTfgoToyXzB+9jq1H3G2wvEyijOaVjYPzkm6Vuw5TQheqRhe0pbKXpDrExHD KizZO2Y96gh4b6+79bl4rp4QEiZsNBmkgS5Eu96qDIpi/ARpd+OYuz3vk9mCKLtEm3 Gg08R6E/vWh1A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D59A3180695 for ; Sat, 1 Jun 2024 05:26:45 +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,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 1 Jun 2024 05:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1717219542; x=1717478742; bh=jwPbJUMJ/zGQ0t8GL2PotnbFSnWm2CvvZXJvlnQkeL8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=KHaM3dQ/wmTfHTd6VtziEQa+HjZeob1zrI3BONqiZxcnqf+Ob1CzQZovBVW8s/7RG 7Ppx0SUn5yeM/gJhRo13piIBpg3YieU27wr1ttsRuHM3m7MdIVaEMbll20pSmUamie YYQdcCJfWQbJz0xTEVl0Vuqp+9M76SGCcN2EpmR8FvrSEwRtgJoiHrwz3y5xau453i M/LvxiR/cjt+RIkSS5PiubDZnCHP61WR5YMuZQrKjjFzlCfqcYFgtHFtHMA6RG/pPI 1AX3wpBC1aHGtaiXiXN35693FuN/3VQxsmlqQ/NCGQWr9yhSMaSrD6mCzZLmAOckdo fYXPOAJCDlLmg== Date: Sat, 01 Jun 2024 05:25:35 +0000 To: Saki Takamachi Cc: php internals Subject: Re: [PHP-DEV] [RFC] [discussion] Correctly name the rounding mode and make it an Enum Message-ID: In-Reply-To: <81CBE5A8-9FAF-40DA-8EAB-9F19C2278E75@sakiot.com> References: <81CBE5A8-9FAF-40DA-8EAB-9F19C2278E75@sakiot.com> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 4e1b488b9481fc10640c52e8a2713a9e5289aab0 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Friday, 31 May 2024 at 15:49, Saki Takamachi wrote: > Hi, internals! >=20 > 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_= enum >=20 > As mentioned previously by Gina on the mailing list [1], there are some i= ssues with PHP's current rounding mode. > [1] - https://externals.io/message/123126 >=20 > =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 mode= s might also be more easily confused, compared to a naming that uses less a= bstract terms. >=20 > To resolve these issues, change the naming to something appropriate and u= se Enums instead of int constants. >=20 > Please see the RFC for details. >=20 > Regards, >=20 > Saki IMHO, part of the RFC should be to amend the "Add 4 new rounding modes to r= ound() function" RFC [1] by *removing* the newly introduced constant and in= stead exposing the functionality *only* via the new Enum. Especially as those constant have not yet been in a stable release of PHP. Other than that, and seeing the confusing of some other people, maybe using= the names "TowardsPositiveInfinity" and "TowardsNegativeInfinity" is bette= r. Best regards, Gina P. Banyard