Re: Add bcround, bcfloor, bcceil to BCMath.
| From: | G. P. B. | Date: | Fri, 29 Sep 2023 17:35:13 +0000 |
| Subject: | Re: Add bcround, bcfloor, bcceil to BCMath. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121179@lists.php.net to get a copy of this message | ||
On Tue, 26 Sept 2023 at 11:10, Saki Takamachi <saki@sakiot.com> 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