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

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

gawk problem


From: Haebich, Terry L
Subject: gawk problem
Date: Thu, 3 May 2001 13:54:45 +1000

I'm trying to convert decimal to hex using gawk but seemed to have reached a
size limit

cat dec2hex
#!/bin/sh
nice /usr/local/bin/gawk -v x=$1 '
  BEGIN { printf("x = %20d decimal, %20x hex, %20o octal.\n",x,x,x); exit}
'

 ./dec2hex 4294967295
x =           4294967295 decimal,             ffffffff hex,
37777777777 octal.

./dec2hex 4294967296
x =          4.29497e+09 decimal,          4.29497e+09 hex,
4.29497e+09 octal.

 gawk -W version
GNU Awk 3.0.5
Copyright (C) 1989, 1991-2000 Free Software Foundation.

Am I doing something wrong or is this a problem? 

I would like to be able to convert decimal numbers up to 20 digits long

I have done a lot of searching on the web and cannot find an answer to this

Thanks,
            Terry



reply via email to

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