Integer Base Calculation in Reverse
December 1, 2009 11:29 AM Subscribe
Math question: Converting a number to a different base is easy enough, but how do I convert it backwards if I already know the end result? In other words, if I know that the number in base 32 is "12", then what is the original number in letters and numbers?
By trial and error I find that the answer is "c". How is the answer calculated? What is the name for this calculation? I am coding in Ruby so it would be wonderful if someone knows of a shortcut already in that language.
posted by cmcmcm to technology (12 answers total) 2 users marked this as a favorite
posted by valadil at 11:33 AM on December 1, 2009