bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Occasional overflow with gmp


From: James Milne
Subject: [bug-gawk] Occasional overflow with gmp
Date: Sat, 19 Oct 2019 16:18:24 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

`awk -V`

> GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2)


Problem seems to be an occasional overflow with gmp.


This works as expected:

> echo '' | awk -M '{print 200000000000000000000000000000000000000000 *
200000000000000000000000000000000000000000 ^ 20000000000000000000}'

> +inf


This crashes:

> echo '' | awk -M '{print 200000000000000000000000000000000000000000 *
200000000000000000000000000000000000000000 ^ 2000000000000000000}'

> gmp: overflow in mpz type
> breaking.awk: line 3: 197234 Done                    echo ''
>     197235 Aborted                 (core dumped) | awk -M '{print
200000000000000000000000000000000000000000 *
200000000000000000000000000000000000000000 ^ 2000000000000000000}'


Should be noted the crash is a slightly smaller number than the larger.


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]