Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number Base Converter
Message
From
25/06/2004 16:20:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/06/2004 15:57:06
Fabian Belo
Independent Developer
Argentina
General information
Forum:
Java
Category:
Other
Miscellaneous
Thread ID:
00917041
Message ID:
00917381
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>>>Thank you Hilmar, it helps. (espacially octal stuff)
>>
>>You are welcome. You don't happen to need the opposite conversion (from decimal to other bases)?
>
>Not really, but It would be nice to have it all.

OK, let's see an example in octal.

Convert 1000 (decimal) to octal.

You could find how often you can fit 8^3, 8^2, etc. into the number; but here is the shortcut:

Doing successive divisions:
Result  Remainder
1000
 125        0
  15        5
   1        7
   0        1
That is, continue dividing until you have a result of 0.

The result in octal is the remainders, read from bottom to top: 1000 (decimal) = 1750 (octal).

With hexadecimal, of course, you have the complication (once again) of converting a remainder between 10 and 15, to the corresponding single digit (A-F).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform