Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11601

Inaccurate output from awk converting very large numbers from hex to decimal

$
0
0

I have a following data: "210000000080401".I need to convert the hex '210000000080401' to its decimal form.

Using Awk is not giving the correct result:

echo 210000000080401|awk -Wposix '{printf "%d %s\n", "0x" $1, $0}'148618787703751680 210000000080401

while the correct value is 148618787703751681

echo 210000000080401 | tr '[:lower:]''[:upper:]'|xargs -i{} bash -c 'printf "%d\n" 0x{}'148618787703751681

Why is Awk not giving the correct output?


Viewing all articles
Browse latest Browse all 11601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>