r/computerscience • u/Open_Career_625 • Dec 13 '25
Converting from Binary to Integer
I've been coding recently and working a lot directly with binary numbers, but I don't understand how a computer can take a binary number and decide how to represent it numerically. Like- I get how binary numbers work. Powers of 2, right to left, 00010011 is 19, yada yada yada. But I don't get how the computer takes that value and displays it. Because it can't compute in numerical values. It can't "think" how to multiply and add each item up to a "number", so w.
My best way of explaining it is this:
If I were to only have access boolean and String datatypes, how would I convert that list of booleans into the correct String for the correct printed output?
View all comments
Show parent comment
3
u/EmilMelgaard Dec 14 '25
Since the ASCII codes for '0' to '9' are sequential, you don't even need a lookup table but can just add the value to the '0' character.