by Shukant Pal

How non-integer values are stored in a float (and why it floats)

Did you ever think how computers work on floating-point numbers? I mean — where does the decimal point go? What if you’re asked in an interview?

Photo by Johannes Plenio on Unsplash

The IEEE 754 floating-point standard defines how non-integer values are encoded in fixed-size types, like the C++ float and the JavaScript Number. It gives us five different formats — but no worries, all of them…