bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] awk integer math.


From: Andrew J. Schorr
Subject: Re: [bug-gawk] awk integer math.
Date: Tue, 16 Sep 2014 09:27:53 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Sep 16, 2014 at 03:48:12AM -0400, Mark Cross wrote:
> awk fails to correctly calculate 6^36 (or equivalent 6**36).
> 
> 
> execute                          -->  gawk 'BEGIN{print 6^36}'
> get                                 -->  10314424798490536576964100096
> code for expected value   -->  export BC_LINE_LENGTH=0; echo "6^36"| bc -l
> expected correct value     -->  10314424798490535546171949056
> diff                                  -->  00000000000000001030792151040
> 
> Using this version: gawk -V     GNU Awk 4.0.1

Please refer to the documentation:

http://www.gnu.org/software/gawk/manual/html_node/Arbitrary-Precision-Arithmetic.html#Arbitrary-Precision-Arithmetic

And in particular:

http://www.gnu.org/software/gawk/manual/html_node/Arbitrary-Precision-Integers.html#Arbitrary-Precision-Integers

Regards,
Andy



reply via email to

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