Support underscores for mpz/mpq assignments from strings

Sergey B Kirpichev skirpichev at gmail.com
Thu Jun 10 13:40:35 UTC 2021


Hello,

a common feature of modern languages is using underscores as visual
separators for digit grouping purposes in integral, floating-point and
complex number literals, see:
https://www.python.org/dev/peps/pep-0515/

Some projects add workarounds for the gmp to allow this syntax, e.g.:
https://github.com/ocaml/Zarith/pull/75

I think, the gmp can accept this syntax.  Tentative patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: underscores.patch
Type: text/x-diff
Size: 2080 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-discuss/attachments/20210610/d6a443fc/attachment.bin>


More information about the gmp-discuss mailing list