Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number Base Converter
Message
From
25/06/2004 07:07:54
Fabian Belo
Independent Developer
Argentina
 
 
To
24/06/2004 20:27:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Java
Category:
Other
Miscellaneous
Thread ID:
00917041
Message ID:
00917139
Views:
17
Thank you Hilmar, it helps. (espacially octal stuff)

>>Dear all;
>>
>>Does anyone has an algorithm to convert from base 8/16/2 to base 10?
>>Thanks.
>
>Let's see an example in octal:
>
>234 (octal)
>
>2 should be multiplied by 8^2 (8 square; right now, I don't remember the syntax in Java). 2 should be multiplied by 8, and 4, simply by 1.
>
>A shortcut, which sort of bypasses the use of powers, is:
>
>(2 * 8 + 3) * 8 + 4
>
>IOW: repeatedly multiply by 8, and add the next digit.
>
>For hexadecimal, you would have to convert "A" to 10... "F" to 15, first, and then apply the same algorithm (multiplying by 16, of course).
>
>HTH,
>
>Hilmar.
"Since I've read that alcohol is bad... I quit reading."
Me


http://www.fabianbelo.com.ar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform