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

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

type conversion error ascii (hex) to integer


From: Lee Howard
Subject: type conversion error ascii (hex) to integer
Date: Mon, 15 Aug 2005 17:30:51 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040731

With GNU Awk 3.1.3 as found on Fedora Core 2...

Consider the following awk program:

 awk 'BEGIN { printf(int("255")) "\n" };'

The output is "255", as expected. Now express the numerical value in hexadecimal:

 awk 'BEGIN { printf(int("0xff")) "\n" };'

The output is "0", not as expected.

This latter program worked as expected with GNU Awk 3.0.6 and Michael D. Brennan's mawk 1.3.3 both as found on RedHat Linux 7.1.

Thanks,

Lee.





reply via email to

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