mini-gmp and scientific notation

Marc Glisse marc.glisse at
Tue Feb 14 07:52:38 UTC 2017

On Mon, 13 Feb 2017, Katelyn McNair wrote:

> Is there a way to get an integer in a string of scientific notation format
> into an mpz_t variable?
> It looks like the only scientific format handling is in mpf_set_str. So my
> only options are:
>     1) Use the full GMP packge (which is not doable due to it's lack of
> portability)

We do try to make it portable, if it doesn't work for you you might want 
to report what fails...

>     2) Copy/paste and code out scientific notation parsing in mpz_set_str

You could also try to use MPFR. I believe they tried to make it usable 
with mini-gmp, no promise though.

Marc Glisse

More information about the gmp-discuss mailing list