bug-gnu-utils
[Top][All Lists]
Advanced

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

SERIOUS BUG: No consistent comparision of string-number vs number


From: Björn Bergqvist
Subject: SERIOUS BUG: No consistent comparision of string-number vs number
Date: Thu, 09 Oct 2003 17:24:05 +0200 (CEST)
User-agent: IMP/PHP IMAP webmail program 2.2.6

when i compare "3000.0" < 4.00 the statement will be true.
Sometimes gawk will do right, sometimes wrong.
I solved it for like this: "3000.0"+0. < 4.00" but ideally some changes should
be made in gawk.
Regards
Björn Bergqvist

#!/usr/bin/awk -f

BEGIN {
stringno[1]="1000.0"
stringno[2]="2000.0"
stringno[3]="3000.0"
for (j=1;j<=3;j++){
for (i=0;i<=5;i+=1){
if (stringno[j]<i)
        print stringno[j],"<",i," is true => BUG!"
        else
                print stringno[j],"<",i," is false => OK!"
}
print "\n"
}
}

...................................................................

  VINN RESA VÄRD 5000:- Tävla på http://www.lokalnyheterna.se/tipsa.php






reply via email to

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