[Win32] set_str() ignores exponent iff base > 36

Paul Zimmermann Paul.Zimmermann at loria.fr
Sun Dec 9 17:51:38 CET 2007


       Rob,

it seems the culprit is the following line in mpf/set_str.c, where exp_base=62:

        exp_in_base = strtol (expptr, (char **) 0, exp_base);

Indeed, "man strtol" says that strtol only supports bases up to 36
(for example under Fedora 7), thus I don't see how it could work.
It thus seems to me that mpf_set_str only works for decimal exponent
(i.e., negative base argument) for base > 36.

You report it works under Cygwin with gcc-3.4.4. What does the manual page
from strtol say?

According to http://gmplib.org/#STATUS, this might be the first known issue
with GMP 4.2.2.

Paul


More information about the gmp-bugs mailing list