Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123476 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 6ACDE1A009C for ; Fri, 31 May 2024 16:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717173784; bh=eSSS3tBQeLWzaHEfIeDEh8g0ig3XrINykNzjEdzkZDA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j9PAREhL5uGVc8vYQszYaicBIM/ee5iqOI6Q0uJfBsaRa2fFH71SL0zo+vsgO59Nc puFvDpv6+1NX8aXcBkdZZdi95pQsYJ0sDzaN82zau8h9ityUfKn3ef3KJz3/LOARLh pZtHSm1RCR9PXvk/H3lzohZ5VK0U0YuO1uhhFxYUbyEGewFtlIcHDjgf2J29kQqsS1 8kwDmokOqsOJPf9STeGJcHUrqi4d3t1BNxoV2oKUy0wHV3mvggVDC8LsDO50cT3USz aYesqdjW4OelqyVrUayvqVYpAenhsaCZEp/V53+ryV+Dl7kEm78Lkqy4SeC5znOd7a y3QLE+VOaAUzA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EC7A01808E4 for ; Fri, 31 May 2024 16:43:03 +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,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=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-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 16:43:03 +0000 (UTC) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2e95a7545bdso22754241fa.2 for ; Fri, 31 May 2024 09:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717173720; x=1717778520; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eSSS3tBQeLWzaHEfIeDEh8g0ig3XrINykNzjEdzkZDA=; b=Ws+ztOzR5wQouYYAqcTP12c9OaruYETD/mFWnh2U9brMUgIhwdH+lu+Zfuzi1fvVoD REwyf8HX9ttPK9cn9iKqyiRhn51rxmWrknh3XhpESdoS1jGMMFfkzMDazLqtxCekgopa 4MELAu8mHlg578aw+FTzshSCl5tezmDktk1/1Usyt+MKup+IIGmSpQG4GLy5sDPuUNZd it47mNz7wnYyjbITyNBK9nKI3WHctZ6PeZ6dAcHBb4ngqFELe2SUSV4C/3O3bLxRBhSW mEzCf0ijQpzDsVDVivgI3vw5s9EWr4kk3nCNIK3zS51RTfpyh7PEQwVqtxW410Xoq+7l mHow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717173720; x=1717778520; h=cc: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=eSSS3tBQeLWzaHEfIeDEh8g0ig3XrINykNzjEdzkZDA=; b=cItg6+1ktPAnFb70mOff7zjBD6ddCR5uIq+OEMh0C+wfFQdq4dfbk5aQ89OkTr68kL dshbo5AAm3XuFLGXZ4vO5kjLvH6d8mWXdO5AjtDAXmN83bceCpyWazjeOyDRkDEVSKJm Pz/K9gLIZ+554rlAbMaIPPzK9A2ZOZKPNzYn1c/fGnvxRdjVFKpLAjnRJ1+CUvXfpHp5 1dG15aeGEbg5HD7e5YDeYM0JAKOAanlWDh2r0iLENHuk1JB8pvB9rTevSLGOGb+xtEMw Bz0mNhtxgUrcSZKw2UWf72Pj0urC5u4YXp47HDMSAyvKYwabFvp5w09z62AJNdoV9O8X R3Eg== X-Gm-Message-State: AOJu0YxYciQPzL5htFjE8odGTrsfuFYOkmtuxzTOvki+z8Llc80NjMZa YjDLmMkyIds+1lJKgpL0YzXzhoT/1uBXSw5rqh2Q56Q4q8YJKx8N/BaBiuTb3oRAZKJEwNvOdOp ebWUtlmB0VjO5XZcox6dTUPKQCXCBcz1/ X-Google-Smtp-Source: AGHT+IFLRR8IxfNnV7RUXlfjLRMkmrq0ZWNi8SSst3+RYaIxIhqBDYYz60bDKZ0lzmTDlUC6CTW8JBc6E912H6e700A= X-Received: by 2002:a05:651c:2004:b0:2e1:e33d:67f6 with SMTP id 38308e7fff4ca-2ea95161081mr15444311fa.28.1717173719562; Fri, 31 May 2024 09:41:59 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <81CBE5A8-9FAF-40DA-8EAB-9F19C2278E75@sakiot.com> In-Reply-To: <81CBE5A8-9FAF-40DA-8EAB-9F19C2278E75@sakiot.com> Date: Fri, 31 May 2024 18:41:48 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC] [discussion] Correctly name the rounding mode and make it an Enum To: Saki Takamachi Cc: php internals Content-Type: multipart/alternative; boundary="0000000000009282ed0619c2a90b" From: jorg.sowa@gmail.com (Jorg Sowa) --0000000000009282ed0619c2a90b Content-Type: text/plain; charset="UTF-8" Hey Saki, I like this change. When I was implementing additional rounding modes for the next PHP version I was initially struggling with the naming and this change will be helpful. I have only one concern about the names `NegativeInfinity` and `PositiveInfinity`. They may be too formal from the user's perspective. As we already have functions `ceil` and `floor` it's more intuitive for developers to understand the logic of ceiling and floor rounding. But if voters will prefer those terms then it makes sense to change the constants implemented in PHP 8.4 (and thus not released yet) from `PHP_ROUND_(CEILING|FLOOR)` to `PHP_ROUND_(POSITIVE_INFINITY|NEGATIVE_INFINITY)` for the sake of consistency. Kind regards, Jorg --0000000000009282ed0619c2a90b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Saki,
I like this ch= ange. When I was implementing additional rounding modes for the next PHP ve= rsion I was initially struggling with the naming and this change will be he= lpful.

I have only one concern about the names `NegativeInfini= ty` and `PositiveInfinity`. They may be to= o formal from the user's perspective. As we already have functions `cei= l` and `floor` it's more intuitive for developers to understand the log= ic of ceiling and floor rounding.

But if voters will prefer th= ose terms then it makes sense to change the constants implemented in PHP 8.= 4 (and thus not released yet) from `PHP_ROUND_(CEILING|FLOOR)` to `PHP_ROUN= D_(POSITIVE_INFINITY|NEGATIVE_INFINITY)` for the sake of consistency.
Kind regards,
Jorg
--0000000000009282ed0619c2a90b--