I am using bc command to make system number conversion.
From decimal to binary, binary to HEX, and HEX to decimal.
But I have a problem with it.
This is the problem:
memam@mSolaris:~$ bc
ibase=2
obase=16
1111
17
Why the output doesn’t appear correctly?
The output must be F?
And when I use ibase=16 and obase=2, it works correctly.
When I change the ibase=10 and obase=2, it works correctly.
ibase=10
obase=2
3
11
but this is true?
Specify the
obasefirst so that it doesn’t try to interpret the value with the radix specified inibase.Or, well…