Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number Base Converter
Message
De
25/06/2004 07:07:54
Fabian Belo
Independent Developer
Argentine
 
 
À
24/06/2004 20:27:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Java
Catégorie:
Autre
Divers
Thread ID:
00917041
Message ID:
00917139
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform