Base Convert and Base Encode

Base Convert

Base conversion is a very basic skill in programming.
I was taught converting between decimal(base-10) and binary(base-2), decimal(base-10) and octal(base-8), decimal(base-10) and hexadecimal(base-16), and of course among base 2-powered numbers(pow(2,n)).

The conversion is quite simple, division is the only arithmetic operation we need.
If we want to convert a base-m number to a base-n number by our hands, the common way is:
1 Convert base-m number A to base-10 number B;
2 Convert base-10 number B to base-n number C.
just because the base-10 is the most familiar base to humans.

Continue reading “Base Convert and Base Encode” »

Base Convert and Base Encode by @sskaje:

Incoming search terms: