Question

I know 75(base8) = 61(base10), but I can't easily find the formula for this. How does one convert from base 8 to base 10?

Was it helpful?

Solution

To convert any base to base 10 just do the following:

For every digit in the different base multiply that by the base and digit. For example:

75 (base 8) = 7*8^1 + 5*8^0 = 61 

Works for any base ... binary, hex, you name it just do that and it will convert to base 10.

OTHER TIPS

0 * 85 + 0 * 84 + 0 * 83 + 0 * 82 + 7 * 81 + 5 * 80 = 61

The formula is 18 = 110 and 108 = 810. Everything else can be derived from that.

If you have a sequence of base 8 digits you want to convert to a base 10 number, process them from left to right, keeping a total you initialize at zero. For each digit x, set the total to 8*total+x. After processing the last digit, the total will be the base ten value of the base 8 sequence.

75 in base 8 = 5*8^0 + 7*8^1 = 5 + 56 = 61

In general, to convert the number a_1a_2a_3...a_n from base k to base 10, use the formula:

a_n*k^0 + a_(n-1)*k^1 + ... + a_1*k^(n-1).

given this is a programming site:

int oct_to_dec = 075;
printf("%d",oct_to_dec);

137461(base8) = 1 x 8^0 + 6 x 8^1 + 4 x 8^2 + 7 x 8^3 + 3 x 8^4 + 1 x 8^5

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top