Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121146 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87664 invoked from network); 26 Sep 2023 10:10:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Sep 2023 10:10:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DC6F2180506 for ; Tue, 26 Sep 2023 03:10:44 -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=-0.2 required=5.0 tests=BAYES_20,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: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 26 Sep 2023 03:10:43 -0700 (PDT) Received: from smtpclient.apple (150.12.156.220.rev.vmobile.jp [220.156.12.150]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 2E3E7401E6 for ; Tue, 26 Sep 2023 19:10:41 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1695723041; bh=ziINaSz58Xl0lv/rj7XS9kp5Q5gJBB6AOMN3nHbnuiY=; h=From:Date:Subject:To:From; b=roD8k7l1MfJyVVy2dxtKHMN/phHtn7vSo+fmp+MPML7ZHFZFJIJVlrfdSsQZgIs+Y WIYlr0sGFtQirmmcZjYfZe9VjV2r7+l3inqXCbe3suJUW3nbnGVaBjuZ55vI+RcWIF lAFC5fXXNFnilBZJRHC0qJzDrDUIksPzvRD1qAdE= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Tue, 26 Sep 2023 19:10:28 +0900 Message-ID: <1FF8038C-908B-456F-A73D-81363111C724@sakiot.com> To: internals@lists.php.net X-Mailer: iPhone Mail (20G81) Subject: Add bcround, bcfloor, bcceil to BCMath. From: saki@sakiot.com (Saki Takamachi) Hi, internals. I'm currently working on renovating the `round()` function. The current `round()` function rounds a value like 0.285 (0.28499....) to 0.= 29 using pre-round. This is a mistake for FP, so discussions are underway to abolish such pre-ro= und behavior. However, there is definitely a user request to round 0.285 to 0.29, so I tho= ught why not add a function similar to the round function to BCMath. Similarly, I'm considering adding similar functionality to `floor()` and `ce= il()`. In rare cases, when dealing with very large values, these will return= a different value than expected as a decimal number. I would love to hear everyone's opinions. Regards. Saki=