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

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

Negative number comparisons in GAWK


From: Kevin Hass
Subject: Negative number comparisons in GAWK
Date: Thu, 19 Apr 2001 15:35:00 -0600 (MDT)

Hi,

I have found a bug in gawk 3.0.6.

I'm using the Slackware 7.1 version of Linux distribution, and the
gawk came with the distribution.

(assuming it was built with the same compiler in the distribution..)
gcc version egcs-2.91.66
libc 2.1.3.so

The nature of the bug:

I have some numeric data, which is also comma delimitted.  I was using
gawk to print only the values less than -1.0, but it prints the values
between -1.0 and 0.0 instead.  These numbers are real numbers, not integers.

This bug goes away when the comma is removed, and works properly.  If a
comma is directly at the end of the numeric value, it fails.

The script used:
gawk ' { if ($1 < -1.0) {print} } ' inputfile >outputfile


Kevin

-- 
Kevin Hass WB0DPN           Transportation Technology Center, Inc
Senior Systems Programmer   Pueblo, CO, USA
(719)-584-0596           
address@hidden   



reply via email to

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