increase mini-gmp base support to 62

Niels Möller nisse at lysator.liu.se
Fri Feb 3 21:10:32 UTC 2017


"Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:

> Applied. But I changed again the code that checks the base. I used the
> following:
>
>  digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
>  if (base > 1)
>    {
>      if (base <= 36)
>        digits = "0123456789abcdefghijklmnopqrstuvwxyz";
>      else if (base > 62)
>        return NULL;
>    }
>  else if (base >= -1)
>    base = 10;

It's documented that base = 0 means base 10. But should |base| = 1 also
imply base 10? Would make more sense to me to treat that as an error.

>  else
>    {
>      base = -base;
>      if (base > 36)
>        return NULL;
>    }

/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list