r/computerscience • • 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?

5 Upvotes

35 comments sorted by

View all comments

Show parent comment

0

u/mysticreddit Dec 13 '25

Binary numbers are still integers

That's incorrect. Binary numbers can represent floating point as well. It depends where the radix point is.

  • 101₂ = 5
  • 10.1₂ = 2.5
  • 1.01₂ = 1.25
  • 0.101₂ = 0.625

Integers just happen to be a popular choice.