[Top][All Lists]

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

[bug-gawk] How does awk implement extremely long integers?

From: Peng Yu
Subject: [bug-gawk] How does awk implement extremely long integers?
Date: Tue, 31 Jan 2012 09:03:05 -0600


I don't see where the limit of an integer in gawk is documented. But I
tried the following code on my MacBook Pro (64bit) with macports
installation. It can store integer as large as 2^1023. (I suspect the
maximum should be something like 2^1024-1, but I never test it). I'm
wondering how gawk store and compute some big integer, as an integer
of this large is beyond any native type supported my the machine.

If some library is used to support long integers, why not use one that
supports infinitely large integer?

~$ seq 1023|awk 'BEGIN{i=1}{i*=2}END{print i}'

~$ seq 1024|awk 'BEGIN{i=1}{i*=2}END{print i+2}'


reply via email to

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