Re: [RFC] [Discussion] Support object type in BCMath
| From: | Saki Takamachi | Date: | Wed, 27 Mar 2024 00:40:45 +0000 |
| Subject: | Re: [RFC] [Discussion] Support object type in BCMath | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122769@lists.php.net to get a copy of this message | ||
Hi Barney,
> Do we also need
toFloat and
> toInt functions? Seems like using explicit functions will be safer
> than casting.
>
> For toInt I'd expect an exception if the value is outside the range of possible ints. For
> toFloat it might be nice to have a flag
> argument to give the developer the choice of having it throw if the value is outside the range
> of floats or return INF or -INF,
> or possibly the user should just check for infinite values themselves.
I was thinking about those features too. However, I'm concerned that proposing too many
features will complicate the RFC and make it difficult to get it approved.
It might make sense to have a second vote on whether to implement those features.
Regards.
Saki