Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120975 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45386 invoked from network); 3 Sep 2023 12:14:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Sep 2023 12:14:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E0EBE1804AC for ; Sun, 3 Sep 2023 05:14:01 -0700 (PDT) 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 3 Sep 2023 05:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1693743240; bh=U30Bz0bahXA+QxauSu8pWV4YbZyXWp1mkQvPlhFSQEY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=lnnF7BMo72SCDVkgnepTBtHZK/A3W023dZT0YcPCf80M5fZY6pqM8KMLYPQuF1cE/ NONRCYc5d27HYYtrA7VIqGIHmDn7sZExLEjZGYdnf1udNoV9TT2IVrFRRYwRhfuIdr +aRT76Y7zn2CUOnYMh5pAelHx6bb3wroj+3ZqT/j+xkOINWICWmRV4mipZ9LBS0YOt xfcmxeDLUpHaIPhpcfVpHcTxd0xfeBMKawPjhtnB2bJWii4c59BU8hdfFCU+d85KyT kUwuugY8JCl2uIGyNmNJsIDXFoaeB0Nvtf9C3kFsH7uissuQwCIHCgatGqJVk627kM Fqo2uHcA+bfgQ== Message-ID: <7f23f0ac-bba6-5997-b737-2a252205cf85@bastelstu.be> Date: Sun, 3 Sep 2023 14:13:59 +0200 MIME-Version: 1.0 Content-Language: en-US To: Jorg Sowa , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 9/2/23 21:33, Jorg Sowa wrote: > RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function The RFC mentions already has a section with regard to naming: > Why not the names PHP_ROUND_UP and PHP_ROUND_DOWN I generally agree with the argument in favor of the names you've chosen. However they are inconsistent with the existing 'PHP_ROUND_HALF_UP' / DOWN constants. I don't want to create extra work for you, but I wonder if additionally one of the following should be done: - Creating PHP_ROUND_HALF_AWAY_FROM_ZERO as an alias for PHP_ROUND_HALF_UP (and likewise for HALF_DOWN). - Adding an entirely new \RoundingMode enum with clear names for all variants. I feel like documenting such an enum with a dedicated page would be easier compared to the PHP_ROUND_* constants which are not directly related, except for the prefix. Furthermore there will be another inconsistency by not having the CEIL/FLOOR variants for the halfway point (i.e. half towards positive infinity and half towards negative infinity). Best regards Tim Düsterhus