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

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

gawk malcfunctioning


From: Maite Merino
Subject: gawk malcfunctioning
Date: Thu, 16 Jun 2005 19:49:43 +0200

Hello,

I'm novice in this topics and very far away from suitables gurus, so forgive me if I'm telling you something ridiculous or stupid here, but I think I've detected a posible bug in gawk v.3.1.4.

I have some very simple scripts that make some calculations reading from a 1-column list of floats (p.ej fwhm.lst). In machines with gawk 3.1.2 and gawk3.1.3 that worked perfectly, but in gawk 3.1.4 it gives me stupid results in two diferents machines.
From printsf I've detected that the problew is because even putting
explicitelly CONVFMT="%.6g", when it does:
BEGIN { s=1.0
...
}
...
END {
...
s+=$1
...
}

in the part with s+=$1 results that if p.ex. $1=2.98 in that line, it adds to s only 2.00, id. est., when it transform from string to float, it makes truncation. And even using the CONVFMT="%.6g" and strtonum($1) still is making truncation every time.
That makes that all the calculation results are wrong!!!

i've tried to desinstall gawk to install again an older version, but it has not worked. And I'm currently working on dayly basis on some very old and complex soft that in the past crashed when I updated the kernel so I'm not going to risk agin touching the system.

I've installed mawk and works perfectly without any truncation problem.

So, my questions are the following:
        -Can you reproduce that posible bug onto other gawk 3.1.4?
        -If so, it was a known bug?
-Can I solve that truncation withour risk at all (not touching system nor kernel)?

Thanks,

Maite





reply via email to

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