Support underscores for mpz/mpq assignments from strings
Marco Bodrato
bodrato at mail.dm.unipi.it
Mon Jun 14 16:26:37 UTC 2021
Ciao,
Il 2021-06-14 10:59 Vincent Lefevre ha scritto:
> I wasn't suggesting to change mpz_set_str, but add another function.
> Changing mpz_set_str to add another argument for a list of separators
> would break the API.
I do not like the idea of a list of separators...
but we may add an "int (*) (int)" argument :-P
This way the user can specify the preferred "isspace" function! :-D
Il 2021-06-14 15:51 Vincent Lefevre ha scritto:
> I think that the GMP manual is clear: mpz_set_str ignores whitespace
> anywhere in the string (contrary to C's strtod, etc.).
To be honest, the GMP manual is not completely correct.
Whitespace is not allowed immediately after the minus "-" sign; nor,
when base = 0, in the middle of the base prefix: "0x", "0X", "0b", "0B"
can not be "0 x", ...
Would you suggest to document the two exceptions, or to change the code
for a strict ignore-everywhere policy?
Ĝis,
m
More information about the gmp-discuss
mailing list