Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123631 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 4B6941A009C for ; Sun, 16 Jun 2024 10:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718535483; bh=4lZIep/q70apBscyi/vEeDGuH7xmHRmkuOC7B3plNBw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MSuEoGxe7cDQgyOvKDP25t0pd126QSM25bdgEyMBVaxbQVUEGdgF1kN/2wv1t5DdP rNU8kWibrWjmpektJqJeuMBWQ3RkK/Q9H7mZAOqjKU5iWCbzynrpFUIOm/YkCFxsEh rz8JBiZWQRG8N8wYPvwLYnq5+98anGbBNyVZDjLiGP8aG2wY5Oxt449LWbs15rrB0b /xNXC3vFHl/scZLWjSO9MM+OV+OEOWKjdjrW6bYoOSbjLA8iEkPMgJjkYoRe3vQ1RE c6OiLEeWAxG7vgSeKcJbkn09Pp9+NI6X25Rm6O37VC4AcpuhQn/Bu/reORLvsSjsMd B6bCHBs7+mvUQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 14859180934 for ; Sun, 16 Jun 2024 10:58:02 +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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Sun, 16 Jun 2024 10:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1718535408; bh=7T77F6Tk85WZYANPonOh4jYiImmnPVw4MoHjTi73R38=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=aNay4J+KcSsAIweSNYgoLfABQBTadOXzTjq9rgqrEncoezo1Mu24BI/RuNb/uEQ6W TDZLyFWpaOhNQaM5KkyXOdPBMOAgUZ6ToaJovT6K+Dxsq3UHHK1g5/rYgzpKMLYcbR QKWdz0oqXXUhfJzk+XuIc0SC6CuVUv6ZIU4LGPVp1U2HtivA4zGF9VNDb4BUNeIn5g 91s3+Fp1rBUhjJvXqae+Of+E5PZuhqsrD2Q/s4oAtHvGEQy8TV09n292EYUFkwt9d1 9Uzgq3I16iSLmPzPfFxZuAEuB61XPCs2IVrf3UiuIADUVufHo0D0r1wzHnzku+HmzX k61GZ4cvB84nw== Message-ID: <67d37d56-625f-4f80-805d-a5db2d3807bb@bastelstu.be> Date: Sun, 16 Jun 2024 12:56:46 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] [discussion] Correctly name the rounding mode and make it an Enum To: "Gina P. Banyard" Cc: Saki Takamachi , Jorg Sowa , php internals References: <9zUVZKaEYixjCLLhviQPYFQtSAEhsRMWL6xbKeogzAGsH-STebN9JqJxITAPVfdKTNu7gEs_m77OkIcOzaiscoajx8Hp8VWRKkhTTCPkGko=@gpb.moe> <6E690732-8BED-4A01-8385-648E7CEDFD9F@sakiot.com> <70f63dd2e0ba7959a9e3bb7fa68ce14a@bastelstu.be> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 6/13/24 03:28, Gina P. Banyard wrote: > Thank you, I think other than possibly prefixing the NegativeInfinity > and PositiveInfinity cases with "Towards" I am happy with the content > of the RFC. I've discussed this with Saki. In that case the `HalfEven` and `HalfOdd` modes would also need to be renamed to `HalfTowardsEven` and `HalfTowardsOdd`, resulting in this: enum RoundingMode { case HalfAwayFromZero; // PHP_ROUND_HALF_UP case HalfTowardsZero; // PHP_ROUND_HALF_DOWN case HalfTowardsEven; // PHP_ROUND_HALF_EVEN case HalfTowardsOdd; // PHP_ROUND_HALF_ODD case TowardsZero; // PHP_ROUND_TOWARD_ZERO case AwayFromZero; // PHP_ROUND_AWAY_FROM_ZERO case TowardsNegativeInfinity; // PHP_ROUND_FLOOR case TowardsPositiveInfinity; // PHP_ROUND_CEILING } Except for the `AwayFromZero` modes, every mode contains `Towards` and especially the `HalfTowardsX` modes are too similar to easily distinguish them visually. Thus we prefer the current state of the RFC where the different modes have plenty of hamming distance, while still being sufficiently descriptive. Best regards Tim Düsterhus