Thanks to the folks at CCIL for hosting these pages.
remlaPS Home Page remlaPS Web Logs at CCIL

Integer Base Conversion Tool

Digits used...
0         1         2         3         4         5         6         7         8         9
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`~!@#$%^&*()-_=+[]{}\|;:,.<>/?'"
Here is the java applet...

Notes:

  • 'A' and 'a' have different values (10 and 36) as do all upper/lower case alpha character pairs.
  • There is very little validation, so it's up to you to avoid overflows.
  • Positive integers only...
    • The dot ('.') is the 89th digit (value=88 if abs(base) > 89), not a radix point.
    • Numerals which start with a dash ('-') start with the 74th digit. They are not negative.
    • Numbers in negative bases are negative if their number of digits is even.
  • Bases which start with a dash ('-') ARE negative. (And negative bases probably don't work yet).

Source:

WebCon.java - GUI stuff
TwoBaseRepObject.java - Interface between GUI and base converstion stuff.
Horner.java - Convert between bases by an additive offset, using Horner's Method followed by divide/remainder.
ExpBaseCon.java - Will implement this algorithm


New: 25 Nov 2007

Author: Steve Palmer (remlaps@ccil.org)

25 Nov 2007