hey guys,
interesting problem i ran upon...
converting from base 10 to say octal, bin, hex is easy
and visa versa.
but with regards to programming shouldn't we be able to write a general procedure that can convert a number from any base to any other base?
i tried to do this, and thought it was fairly simple but got stuck really fast?
anybody have any idea's?
so to make myself clearer
say i have a procedure Convert (num, base, toBase)
x = Convert (5, 10, 2)
print (x)
should print 101
any idea's guys?
interesting problem i ran upon...
converting from base 10 to say octal, bin, hex is easy
and visa versa.
but with regards to programming shouldn't we be able to write a general procedure that can convert a number from any base to any other base?
i tried to do this, and thought it was fairly simple but got stuck really fast?
anybody have any idea's?
so to make myself clearer
say i have a procedure Convert (num, base, toBase)
x = Convert (5, 10, 2)
print (x)
should print 101
any idea's guys?