Size of variables in awk

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Mar 2 23:29:34 PST 2004


On Wed, Mar 03, 2004 at 02:25:27PM +1030, Wayne Sierke wrote:
> It seems I've run into the 32-bit signed number wall in awk
> (5.2-RELEASE).
> 
> My totals are maxing out at 2147483648.
> 
> Would anyone happen to know whether that's really the case (that awk is
> only implemented with 32-bit number capability - unfortunately I don't
> have any other awks nearby to verify nor can I find any reference info
> that indicates) and/or can suggest a way around it?

Use perl instead?  Perl should switch from an integer to a floating
point representation internally if it runs over MAXINT.  You should be
able to use a2p(1) to automatically convert your awk code into perl.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040303/ae22123a/attachment.bin


More information about the freebsd-questions mailing list