# Base Change Calculator:

Base to Convert to:

The number is:

Converting Into Another Base

Above is the javascript implementation from making a number in base 10 to another base. It uses the toString(radix) function. That gives you the number into a string with base radix. For java, you can change from a base to base 10, and then from base 10 to another base easily. This requires two very short built-in functions:

With a string s that is base radix, and you want to convert it into base 10,

Integer.parseInt(s,radix); converts the string s that was in base radix into a integer in base 10.

With a Integer n that is in base 10 and you want to change it into a string s in base radix.

Integer.toString(n,radix); converts the int n in base 10 into a string that is in base radix.

These functions are very short pieces of java code that allow you to change from one base to another very easily. You should use these to your full advantage. In addition, if you do not use java, there is my useful javascript calculator on the top of the page that can change a number from base 10 to any radix that is 36 or less.

With a string s that is base radix, and you want to convert it into base 10,

Integer.parseInt(s,radix); converts the string s that was in base radix into a integer in base 10.

With a Integer n that is in base 10 and you want to change it into a string s in base radix.

Integer.toString(n,radix); converts the int n in base 10 into a string that is in base radix.

These functions are very short pieces of java code that allow you to change from one base to another very easily. You should use these to your full advantage. In addition, if you do not use java, there is my useful javascript calculator on the top of the page that can change a number from base 10 to any radix that is 36 or less.

Provided by website-hit-counters.com site. |