Re: Extension: arbitrary precision decimal arithmetic in PHP 7
| From: | Benjamin Morel | Date: | Tue, 23 Oct 2018 12:45:41 +0000 |
| Subject: | Re: Extension: arbitrary precision decimal arithmetic in PHP 7 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-103374@lists.php.net to get a copy of this message | ||
Just for the record, I've written a userland arbitrary precision arithmetic library, that
provides a BigDecimal class which should be pretty similar to what you're aiming to do:
https://github.com/brick/math
This library uses the existing GMP or BCMath extensions when available, but also works without them,
using a (slower, but fully functional) pure PHP implementation.
A new PHP extension that would provide native arbitrary precision numbers with an OO API would be
welcome, IMO.
Maybe brick/math can help inspire your API?
Benjamin
> Le 29 sept. 2018 à 01:05, Rudi Theunissen <rtheunissen@php.net> a écrit :
>
> Hi everyone,
>
> I've been working on adding arbitrary precision decimal support as an
> alternative to *bcmath. *I have created an extension based on *mpdecimal*,
> which is what Python 3's decimal module is also based on. I haven't
> released or broadcast this project yet, because I wanted to discuss the API
> and implementation with internals first.
>
> See: https://github.com/php-decimal/php-decimal
>
> Any advice, commentary or objection is welcome. :)
>
> Thank you,
> Rudi Theunissen
>
> --0000000000001ef4ff0576f68080--
>