Subject: RE: ipf counting and rrdtool
To: None <netbsd-users@NetBSD.ORG>
From: Bruce Anderson <brucea@spacestar.net>
List: netbsd-users
Date: 07/13/2001 01:07:01
On Thu, Jul 12, 2001 5:01 PM, Greg A. Woods <mailto:woods@weird.com> wrote:
>You might want to look at Ruby, Python, or even just plain /bin/sh & nawk
>
>I'd avoid gawk and mawk as they both corrupt large integers into floats,
>and you're likely going to have to deal with large integers here!
>
>	$ nawk 'END {print 4294967296 + 4294967296}' < /dev/null
>	8589934592
>	$ gawk 'END {print 4294967296 + 4294967296}' < /dev/null
>	8.58993e+09

Because gawk's
OFMT default is "%.6g"
change it: OFMT="%.17g" 
Or use printf 
gawk 'END {printf "%.10g\n", 4294967296 + 4294967296}' < /dev/null


>	$ mawk 'END {print 4294967296 + 4294967296}' < /dev/null 
>	8.58993e+09
>
>Which you choose should be dictated by whatever previous programming
>experience you have.  If you don't already know and like perl I'd avoid
>it like the plague if I were you!  ;-)  Personally I'd choose ruby if I
>didn't think sh+awk would be simple enough....
>





" Stamp out root logins .  .  .  . su "   --Bruce Anderson  
 This message was created and sent using Cyberdog 2.0, MacOS 8.6,
 awk, find, sed, sendmail, sh, and NetBSD a free Multi-Platform OS.
 NetBSD runs on thirty-one  different system  architectures featuring
 twelve distinct families of CPUs.   http://www.netbsd.org/