03-8-2007, 04:10 PM | #1 |
FFR Player
Join Date: Jun 2006
Location: New York
Age: 32
Posts: 504
|
Base Conversions
Hey all,
I have to make a program that converts from any base number system to another. I know how to do anything to base ten, but how do you go from anything to anything? Going to base ten is simple: digit3 * base^2 + digit2 *base^1 +digit1*base^0 etc; but how do you set it up to go from other bases? I know its easy, but I can't think of the setup -.- Thanks. |
03-11-2007, 07:39 PM | #2 |
FFR Player
Join Date: Jun 2006
Location: New York
Age: 32
Posts: 504
|
Re: Base Conversions
Thanks for the help everyone :/
I got it working. |
03-11-2007, 10:29 PM | #3 |
FFR Player
|
Re: Base Conversions
Congrats on getting it working =]
Sorry about that, I honestly didn't know how I could get that done. What language were you doing this in? |
03-12-2007, 08:06 AM | #4 |
FFR Player
Join Date: Jun 2006
Location: New York
Age: 32
Posts: 504
|
Re: Base Conversions
Java -- all standard classes (String Scanner and StringBuffer is all I used I think :s, oh and the Math class )
Last edited by RandomPscho; 03-12-2007 at 03:26 PM.. |
04-15-2007, 06:51 PM | #5 |
FFR Player
Join Date: Apr 2007
Location: New York
Posts: 27
|
Re: Base Conversions
I know it has something to do with s.toString(int, int)...with s being a String and those two ints being something and the base you want...I forgot the exact usage though
__________________
http://spzc.net/ |
04-15-2007, 08:23 PM | #6 |
FFR Player
Join Date: Jun 2006
Location: New York
Age: 32
Posts: 504
|
Re: Base Conversions
|
04-15-2007, 10:33 PM | #7 |
Banned
|
Re: Base Conversions
Oh damn I wish I had my old C++ base converter for you, it did any conversion from 32 down.
|
04-16-2007, 05:15 AM | #8 |
FFR Player
Join Date: Jun 2006
Location: New York
Age: 32
Posts: 504
|
Re: Base Conversions
Mine does up to 35
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|