Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!mephisto!prism!hydra!burns From: burns@gatech.edu (James E. Burns) Newsgroups: comp.sys.next Subject: Bug in awk? Message-ID: Date: 30 Sep 90 13:20:40 GMT Sender: news@prism.gatech.EDU Distribution: usa Organization: School of ICS, Georgia Tech Lines: 31 I have encountered what seems to be a bug in awk on the NeXT. (I am using an original Cube with Version 1.0 software.) The following awk script works correctly on Sun and Sequent but gives the results as shown on NeXT: #junk.awk --- a bug demonstration BEGIN {w=14582641; l=2754258; t=204911} {} END {s = w+l+t v = w+t+l print w,l,t,s,v } NeXT output: 14582641 2754258 204911 17541812 17541810 Correct output: 14582641 2754258 204911 17541810 17541810 This looks like an overflow problem, but I haven't been able to pin it down. Does anyone know what is going on? My confidence in using awk for grade computations is dropping rapidly! jim burns -- James E. Burns Associate Professor (404) 894-3816 College of Computing, Georgia Tech, Atlanta GA 30332-0280 Internet : burns@CC.GATech.edu uucp: ...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!cc!burns