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 15:16:01 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Feb 07, 2018 at 03:09:09PM -0500, Andrew J. Schorr wrote:
> This looks like a precision problem. On Linux:
> 
> bash-4.2$ echo 
> 123456790123456790123456790123456790123456790123456790123454320987654320987654320987654320987654320987654320987654321
>  1234567901234567901234567901234567901234567901234567901234 | ./gawk -M 
> '{printf "%d\n", $1/$2}'
> 99999999999999997168788049560464200849936328366177157906432

This is interesting:

bash-4.2$ echo 
123456790123456790123456790123456790123456790123456790123454320987654320987654320987654320987654320987654320987654321
 1234567901234567901234567901234567901234567901234567901234 | ./gawk -M -l 
extension/.libs/intdiv.so '{printf "%d\n", $1/$2; intdiv($1, $2, r); print 
r["quotient"]}'
99999999999999997168788049560464200849936328366177157906432
100000000000000000000000000000000000000000000000000000000044

So the intdiv function seems to operate using higher precision. I imagine you 
get
the same answer for both on MacOS...

Regards,
Andy



reply via email to

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