Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121017 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80316 invoked from network); 8 Sep 2023 15:10:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Sep 2023 15:10:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8744E1804D0 for ; Fri, 8 Sep 2023 08:10:48 -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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 8 Sep 2023 08:10:48 -0700 (PDT) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-59b50b4556eso12331807b3.1 for ; Fri, 08 Sep 2023 08:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694185847; x=1694790647; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=+zHRviInJ1SYu0fmu3olL5eaxc/YXR4isjeNmzK9Tes=; b=XAyzt084JGArQQhA7fMEbc9r58H1RxtZvN7z3YnGTAG1Yc4hPeQK/WaLLFSULfVovY pWaoItBCehhspbrHCyiHiLHmfT5bERbCuBYrCk0BOPlFYpDQh5ZlFn7zypFaZ2aKyq9n Ad5g3Ns0GMSZSQ6W4+gAmKf0OYTTLdkpQtDvL9WKwDlbw3l/SUaP2q1XT2BTwkAzf7B7 jYYowqvS4Ur9llL5jvvB+03uAZgOY7n/B6ZXVngumlGPAfbzkIoK27JztWvf0lnDdAWn spjybG3c5IFXGl7hkoGBzQ9SWqo0H5KkHkAOR7WmcR96O4M/4SPvDzgzTSW/5vnXgvaD 8EKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694185847; x=1694790647; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+zHRviInJ1SYu0fmu3olL5eaxc/YXR4isjeNmzK9Tes=; b=XzdRdwE1PPVbFPlPDyHSeda/ltst6B+CFK/C1RcJrbqn/+oD7B5WeQUp6rgNJ+e9bP vz+YUfdJpTxQzo33QFD/8lngrJhSh0JiDES/2+OtUCmdxmLiH6/3uxw1MVTlaWi2SEBl yM7IG1Xfhtu/uKSY4JbKklLJczxcV6S86V9n9rWl1IUCish9wR6tjO1g7MWyL8aZb3Iq XwJwsevShMNbmkAuQs4NyQ0mKbI/kwPq1UQ9U4oARVClT89L7F4OKAnKRoK9h6rSqsdo tPjjtWxi+tEG52getAzJdjI/LbyK7ZvyNJ7ZD4W5LrgrM4R0clQlUz8MdeNI/f+IZvzs fwQA== X-Gm-Message-State: AOJu0YzuKru2t3aYuiLRAZ/QPGVunsjn3D/ahVC3DySP/KzNHeKXa0ae 7V/kPvxyehVvVCHMwo2tM3xpYH72MLLQQ5Tjy25BK4c7WZ4egF5Z/HQ= X-Google-Smtp-Source: AGHT+IGJSs4t14ArSObEDupZsPfRyuxrAIK8L29MGi+ynG7+m5W8xCOf4yY95i2BSoSBwlLHonM8EeutMqyj0GUsf10= X-Received: by 2002:a25:ced1:0:b0:d7e:be01:baaa with SMTP id x200-20020a25ced1000000b00d7ebe01baaamr2817694ybe.11.1694185847147; Fri, 08 Sep 2023 08:10:47 -0700 (PDT) MIME-Version: 1.0 References: <7f23f0ac-bba6-5997-b737-2a252205cf85@bastelstu.be> In-Reply-To: Date: Fri, 8 Sep 2023 18:10:29 +0300 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000009a556a0604da619a" Subject: Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --0000000000009a556a0604da619a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 7, 2023 at 11:10=E2=80=AFPM Jordan LeDoux wrote: > > As someone who maintains a math library in PHP that has its own expanded > rounding implementation, I will politely disagree. Away from zero, toward= s > zero, towards positive infinity, and towards negative infinity are > completely and utterly unambiguous and provide the developer with precise > control over what behavior they want. I don't see a reason to use somethi= ng > that we KNOW is ambiguous when we're designing it. > > I agree. My main point was consistency. On Tue, Sep 5, 2023 at 1:34=E2=80=AFAM Jorg Sowa wrot= e: > Thank you all for the comments. The naming brought some constructive > discussion. > > My preferred solution would be inconsistent PHP_ROUND_AWAY_FROM_ZERO and > PHP_ROUND_TOWARD_ZERO as those are friendlier to the most of developers a= nd > are not possible to mistake with other modes. I would go even one step > further and create aliases for NumberFormatter constants to have the nami= ng > consistent. > > Yes, this is a great way to achieve consistency, adding aliases also in NumberFormatter. Thank you, Alex --0000000000009a556a0604da619a--