Whitespace after minus sign in mpz_set_str

Marc Glisse marc.glisse at inria.fr
Mon May 8 12:19:49 CEST 2023


On Sun, 7 May 2023, Fredrik Johansson wrote:

> Dear GMP developers,
>
> According to the documentation for mpz_set_str, "White space is allowed in
> the string, and is simply ignored". Indeed,
>
>    mpz_set_str(x, "-12 3", 10)
>
> works.
>
> However, mpz_set_str returns that the string is invalid when a space
> appears between the minus sign and the first digit. For example,
>
>    mpz_set_str(x, "- 123", 10)
>
> does not work.

This was also discussed in 
https://gmplib.org/list-archives/gmp-bugs/2013-December/003257.html

I don't know if anything changed...

-- 
Marc Glisse


More information about the gmp-bugs mailing list