Re: Re: GMP and empty()
| From: | Nikita Popov | Date: | Mon, 30 Dec 2013 14:19:47 +0000 |
| Subject: | Re: Re: GMP and empty() | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70920@lists.php.net to get a copy of this message | ||
On Mon, Dec 30, 2013 at 11:36 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> I would like to have float support rather than this dirty patch.
> We may implement GMP float support. It would be easier with object.
>
> Regards,
>
Current GMP ext exposes mpz functionality. It can be used for discrete
mathematics, e.g. modular arithmetic in the context of asymmetric crypto.
The mpq and mpf functionality also provided by gmp/mpir are something
completely separate. If you like, you can expose them to PHP as GmpRational
and GmpFloat, but you must keep them separate, otherwise you'll render the
gmp ext useless for the purposes it is currently used for. Before doing
that I would recommend to think about whether you really want bignum
rationals and floats or whether you are looking for decimals (something
traditionally provided by bcmath, but could also be implemented on top of
mpz).
Nikita