bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] macOS: mpfrsqrt check fails on gawk-4.2-stable and master


From: Andrew J. Schorr
Subject: Re: [bug-gawk] macOS: mpfrsqrt check fails on gawk-4.2-stable and master branches
Date: Wed, 7 Feb 2018 18:04:54 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Feb 07, 2018 at 10:01:35PM +0100, Hermann Peifer wrote:
> Not really, see below. After adding PREC=400 on the command line, the
> division result is correct, but not the result of intdiv().
> 
> Hermann
> 
> $ echo
> 123456790123456790123456790123456790123456790123456790123454320987654320987654320987654320987654320987654320987654321
> 1234567901234567901234567901234567901234567901234567901234 | ./gawk -M
> -l extension/.libs/intdiv.so '{printf "%d\n", $1/$2; intdiv($1, $2, r);
> print r["quotient"]}'
> 99999999999999997168788049560464200849936328366177157906432
> 99999999999999997168788049560464200849936328366177157906432
> $
> $ echo
> 123456790123456790123456790123456790123456790123456790123454320987654320987654320987654320987654320987654320987654321
> 1234567901234567901234567901234567901234567901234567901234 | ./gawk -M
> -l extension/.libs/intdiv.so -vPREC=400 '{printf "%d\n", $1/$2;
> intdiv($1, $2, r); print r["quotient"]}'
> 100000000000000000000000000000000000000000000000000000000044
> 99999999999999997168788049560464200849936328366177157906432

Very interesting. And what happens if you use the intdiv0 function
instead (with and without PREC=400?

Thanks,
Andy



reply via email to

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