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

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

Re: printing big decimals


From: Aharon Robbins
Subject: Re: printing big decimals
Date: Tue, 25 Mar 2003 11:34:59 +0200

Hi Russ.

It's documented in the texinfo manual; other awks tend to coredump or
print bizarre results.  gawk notices that the number is out of range
and switches to %g format.

%d -> %.0f makes sense, but I haven't thought about it yet in the
case where a field width and/or precision are supplied to %d and the
number overflows....

FYI, 3.1.2 is now released.

Thanks,

Arnold

> To: address@hidden
> subject: printing big decimals
> From: "Russ Cox" <address@hidden>
> Date: Mon, 24 Mar 2003 16:20:03 -0500
>
> running gawk-3.1.1.
>
> gawk 'BEGIN{x=5*1024*1024*1024; printf("%d\n", x);}'
>
> prints 5.36871e+09.  i think the implicit format for 
> overflow of %d should be %.0f rather than whatever
> it is.  that would preserve the illusion a bit longer.
> i can't find mention of this in the man page.




reply via email to

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