HeloutthisCEnerd
New member
- Joined
- Apr 6, 2022
- Messages
- 2
Question
Given N which is base n where N > 2 and n > 2 and M which is base m where M > 2 and m > 2 as well N > M and n > m write a procedure to convert N base n to M base m.
I know how to convert from base n to base 10, but I'm unsure about going from base 10 to base m. There is a general equation in trying to derive. I understand the process of using modulus and finding the remainders, but I am struggling to figure out an equation. Any help would be appreciated.
The general equation I was referring to:
Convert from source base to decimal (base 10 ) by multiplying each digit with the base raised to the power of the digit number (starting from right digit number 0):
decimal = ∑(digit×basedigit number) Convert from decimal to destination base: divide the decimal with the base until the quotient is 0 and calculate the remainder each time. The destination base digits are the calculated remainders.
Given N which is base n where N > 2 and n > 2 and M which is base m where M > 2 and m > 2 as well N > M and n > m write a procedure to convert N base n to M base m.
I know how to convert from base n to base 10, but I'm unsure about going from base 10 to base m. There is a general equation in trying to derive. I understand the process of using modulus and finding the remainders, but I am struggling to figure out an equation. Any help would be appreciated.
The general equation I was referring to:
Convert from source base to decimal (base 10 ) by multiplying each digit with the base raised to the power of the digit number (starting from right digit number 0):
decimal = ∑(digit×basedigit number) Convert from decimal to destination base: divide the decimal with the base until the quotient is 0 and calculate the remainder each time. The destination base digits are the calculated remainders.