+ 3
Base 3 to 10
Hi, Iâm Lisa, a French programmer and I try for a few days to convert a number from base 3 to 10 without using the int () function. Can anybody help me ?
2 Answers
+ 4
Understanding number systems and bases seems daunting but the logic behind it is quite simple.
Here's a helpful link.
https://mathbits.com/MathBits/CompSci/Introduction/tobase10.htm
Example:
1201 base 3 to base 10
1 x 3^0 = 1
0 x 3^1 = 0
2 x 3^2 = 18
1 x 3^3 = 27
1 + 0 + 18 + 27 = 46
1021 base3 == 46 base10
+ 1
Bonjour, Lisa !
Welcome to SoloLearn! What language are you attempting this in?