1. 27
  1.  

  2. 3

    I have always thought of floating point as a version of scientific notation where all numbers are binary (and the base of the exponent is two). Floating point is not as mysterious with this mental image.

    Standards can still specify weird things (for example, adding a 0 to a floating point number can change the number; specifically, it unsets the sign bit if it is set), but you can explain most (all?) of the gotcha’s with floating point numbers.

    1. 3

      Woah, this was really cool. Definitely made it click for me!

      1. 2

        This is great, thanks! It’s nice to know I’m not the only one out there allergic to formulas.

        1. 1

          I really enjoyed the diagrammatic explanation, esp. with Float Toy and paper at hand.

          Stories with similar links:

          1. Floating Point Visually Explained via yumaikas 3 years ago | 10 points | no comments