Whitespace after minus sign in mpz_set_str

Fredrik Johansson fredrik.johansson at gmail.com
Sun May 7 15:37:12 CEST 2023


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.

Fredrik


More information about the gmp-bugs mailing list