I need to convert a very big number in its hex form (no spaces, no anything e.g. 8ac7230489e80001). Using printf
gives an out of range error.
printf '%x\n' "24267339429148234667523"
-bash: printf: warning: 24267339429148234667523: Numerical result out of range
ffffffffffffffff
I tried other methods (python), but it seems they only give a string output. I still need it to be a number. Is it possible to handle numbers larger like this?
You can use the bc
utility:
bc <<< 'obase=16;24267339429148234667523'