2009年2月3日 星期二

Quick command-line Numeral Conversion within Shell

(hex)15A -> (dec)346

echo 'ibase=16;obase=A;15A' | bc

ibase = input base
obase = output base
the default notation for both is decimal
if you want to specify decimal for obase, you should use obase=A ( A in hex = 10 in decimal )
input number must be in upper case

沒有留言: