Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121179 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33299 invoked from network); 29 Sep 2023 17:35:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Sep 2023 17:35:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B6B57180549 for ; Fri, 29 Sep 2023 10:35:26 -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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 ; Fri, 29 Sep 2023 10:35:26 -0700 (PDT) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2777a5e22b5so6384247a91.1 for ; Fri, 29 Sep 2023 10:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696008925; x=1696613725; 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=asdeZo11lzTjEQ6CK1XOSKotwvbe6HqzB2dzpzVa18Y=; b=R/t10HJnpVyESaIEJoADoR6SQTObNcYfWeckvvHLKlBsyB/e1J2QXfW/5DVGojGy2d S0b7hf37xYa4NQLr6NxKKYPd0KwLIYAFkqfAPB6K+oYAhgkmfujGVBl+tA5i6hd7E6GU K8oixSb7QHZs5/yzXoeG1rV5zI4ybwpNq8AadbVtkCxUlTueZxaw7n1Oa2IUTbmTa+hM 4bUf1evRxh9/MJBf7zfpTQCyFOjD6H9AnIzsFxONv863cHOfkybB7hJiaPlreZOqfrsR HglL5qzzSk/3KaorSedG3GUZ7O52ZN7cTViel9l2GwR5sQKaHGEIVz3dUqcJCAo3UHxt kc1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696008925; x=1696613725; 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=asdeZo11lzTjEQ6CK1XOSKotwvbe6HqzB2dzpzVa18Y=; b=MnZW2UC3/6nfFpWNp9UvP0YON116GuMBBuUswMSuZEu3SQQp+2KafPMEAfQSh8obU9 a4+iOzf+pIJEfcvt0r3YEGrbuorlB9pY+dhwjHr5zz26LnMAsfmgfP2KTgSwNY13205l /2r2nI4yYfVBVjOlGaQtMgYhxOOJzjKt0k8JC6UMx06hYGJo1LbszEI/zTm1rzGiTIxR Tuzg1rx1JdRmjx67BCoLGSG35y8/ehCizJ8h3TY0dUee7bwuMrEkhtsveHRQnUD5nY9F YV4YPBzyKVGTamlJ9FMXHfs7Is0u20Xk+Ir+lqFXHSLJYPzPiJwliurkU3fpREbsnwFQ SbtQ== X-Gm-Message-State: AOJu0YxCb0lemOoPytwmi4Jfo+ekmzdvpPwkP5Vb86uwQYHFSlr6+oIw Yf74NTBwjnWU+cfRqoH3sr1ZmAvTRNtBx17M9SE4JoK4GuwPcA== X-Google-Smtp-Source: AGHT+IHDJA/9vBEgk8NNhjztZjUtfm8Tj0MMvfk74jhD/ckx7ylYiZzqiSn/7HkYQb0JCceGX2jEYd9WbLo73i6nXfY= X-Received: by 2002:a17:90a:e002:b0:262:f06d:c0fc with SMTP id u2-20020a17090ae00200b00262f06dc0fcmr4838095pjy.7.1696008925079; Fri, 29 Sep 2023 10:35:25 -0700 (PDT) MIME-Version: 1.0 References: <1FF8038C-908B-456F-A73D-81363111C724@sakiot.com> In-Reply-To: <1FF8038C-908B-456F-A73D-81363111C724@sakiot.com> Date: Fri, 29 Sep 2023 18:35:13 +0100 Message-ID: To: Saki Takamachi Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000083ed67060682d9f8" Subject: Re: [PHP-DEV] Add bcround, bcfloor, bcceil to BCMath. From: george.banyard@gmail.com ("G. P. B.") --00000000000083ed67060682d9f8 Content-Type: text/plain; charset="UTF-8" On Tue, 26 Sept 2023 at 11:10, Saki Takamachi wrote: > 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-round behavior. > > However, there is definitely a user request to round 0.285 to 0.29, so I > thought why not add a function similar to the round function to BCMath. > > Similarly, I'm considering adding similar functionality to `floor()` and > `ceil()`. 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. > I think regardless of the issues around round(), ceil(), floor(), etc. having the equivalent functions for BCMath makes a lot of sense to me. Best regards, George P. Banyard --00000000000083ed67060682d9f8--