mpz_set_str and mpz_init_set_str fail when white space immediately follows the minus sign, for example with the string "- 1". Other strings like " -1 1 " are parsed correctly.
This code:
#include <gmp.h>
#include <stdio.h>
int main()
{
mpz_t z;
int ret = mpz_init_set_str(z, "- 1", 10);
printf("%d\n", ret);
return 0;
}
outputs:
-1
_______________________________________________
gmp-bugs mailing list
[email protected]
https://gmplib.org/mailman/listinfo/gmp-bugs
