Re: [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath
| From: | Saki Takamachi | Date: | Tue, 03 Oct 2023 09:13:11 +0000 |
| Subject: | Re: [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121213@lists.php.net to get a copy of this message | ||
> yes, they do, as do almost all floating points implementation.
>
> Memory limited float values and their respective operations are still useful in many areas, but
> financial values and the likes. Scaled integers are the way for accuracy.
>
>
> Also, side note, gmp recommends to rely on
> https://www.mpfr.org/ for accurate FP operations
Hi
This seems to be a floating point number with extremely high precision compared to regular long
doubles. However, as you say, even though the accuracy is very high, errors still occur. (the error
is so small that it almost never becomes a problem.)
By its very nature, BCMath does not introduce any errors. It is debatable whether floating point
calculations in GMP can play the role of BCMath.
Regards.
Saki