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

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

Re: [gawk] type conversion error ascii (hex) to integer


From: Lee Howard
Subject: Re: [gawk] type conversion error ascii (hex) to integer
Date: Tue, 16 Aug 2005 07:59:06 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040731

Stepan Kasal wrote:

Hello,

On Mon, Aug 15, 2005 at 05:30:51PM -0700, Lee Howard wrote:
With GNU Awk 3.1.3 as found on Fedora Core 2...
[...]
awk 'BEGIN { printf(int("0xff")) "\n" };'

The output is "0", not as expected.

use either:

awk --non-decimal-data 'BEGIN { printf(int("0xff")) "\n" };'
awk 'BEGIN { printf(strtonum("0xff")) "\n" };'

Thanks for your reply.

Unfortunately, neither --non-decimal-data nor strtonum are portable.

Lee.




reply via email to

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