|
From: | Philip Rowlands |
Subject: | Re: FAIL: df/total-awk.log |
Date: | Sat, 11 Oct 2008 12:07:33 +0100 (BST) |
User-agent: | Alpine 1.00 (DEB 882 2007-12-20) |
On Sat, 11 Oct 2008, Jim Meyering wrote:
Actually, that might be due to something else. What version of awk are you using? With the versions of gawk I've tried (3.1.5 and 3.1.6), it doesn't use the offending format: $ awk 'BEGIN {print 2607560286}' 2607560286 Ah ha! But if i use mawk, it does: $ mawk 'BEGIN {print 2607560286}' 2.60756e+09 This might be the last straw. If my patch doesn't work for you, then I'd welcome a rewrite of that test to make it use perl (and to skip it if perl is not available).
I get the same results as Jim, even though on my system (Ubuntu Hardy) both gawk and mawk docs state OFMT defaults to "%.6g".
I can't tell why OFMT is being ignored here by gawk - although I found a bug-gnu-utils post suggesting a difference between printing integers vs floating-point, this can't be right:
$ gawk --version GNU Awk 3.1.6 $ gawk 'BEGIN {print 2607560285.99}' 2.60756e+09 $ gawk 'BEGIN {print 2607560286.00}' 2607560286 $ gawk 'BEGIN {print 2607560286.01}' 2.60756e+09 Cheers, Phil
[Prev in Thread] | Current Thread | [Next in Thread] |