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

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

RE: gawk printf format problem with negative numbers


From: Shaffer, Kenneth
Subject: RE: gawk printf format problem with negative numbers
Date: Wed, 29 Oct 2003 07:58:35 -0500

> The crux of the problem is the compare "if (tmpval < INTMAX_MIN)"... it
> thinks -1234 is less than the maximum negative number and so goes to
> "out_of_range" which then formats it as a float.
...
> > echo |gawk '{n = -1234; printf("0x%x\n",n+0)}'
> 0x-1234

Yes, the #define was broke, however, on another note, if I specify a format of 'x', it should try to print as hex and not revert to float if it exceeds the min or max, IMHO.  Better to print the min or max in hex.

--
Ken Shaffer
Staff Software Engineer
770-236-3421
address@hidden
 



- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.

reply via email to

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