+ 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 ?

1st Nov 2019, 9:44 PM
Lisa
Lisa - avatar
2 Antworten
+ 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
2nd Nov 2019, 12:28 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
+ 1
Bonjour, Lisa ! Welcome to SoloLearn! What language are you attempting this in?
1st Nov 2019, 9:52 PM
Brock Miller
Brock Miller - avatar