Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialkaran Badhwar
Web Development Techdegree Graduate 18,135 PointsRadix?
What is radix, I tried looking up on MDN, but the language used is so hard to understand.
Anybody can help with the Radix? please
1 Answer
Steven Parker
231,261 PointsThe word "radix" refers to the number system of a value, and is how many values can be expressed in a single digit. What we normally think of as a number is radix 10. If you work with binary, that's radix 2.
A few examples of counting in different radixes might make it more clear:
// counting in radix 10 (also called "decimal"):
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ...etc.
// counting in radix 2 (also called "binary"):
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001 ...etc.
// counting in radix 16 (also called "hexidecimal"):
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12 ...etc.
// counting in radix 5 (not commonly used):
0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22 ...etc
Note that the value of a number is relative to the radix. When we see "12" we think of that as a "dozen", but that's only true for decimal numbers (radix 10). In radix 16 what looks like "12" has a decimal value of 18, in radix 5 it would be the same as 7 decimal, and it would not be valid at all in radix 2 (binary), since the only valid digits in binary values are "0" and "1".
karan Badhwar
Web Development Techdegree Graduate 18,135 Pointskaran Badhwar
Web Development Techdegree Graduate 18,135 PointsThankyou Steven Parker, you save me a lot from problems. I really appreciate it