• 0 Posts
  • 3 Comments
Joined 6 months ago
cake
Cake day: December 29th, 2023

help-circle

  • I feel the need to point out that a float isn’t an integer with a decimal stuck on. A floating point number is called that because the precision on both sides of the decimal point changes depending on the size of the number.

    It’s actually stored as an exponent and a value to apply the exponent to. This allows you to express incredibly tiny numbers and incredibly large numbers, but the gaps between representable numbers is inconsistent.

    You know how 10 / 3 * 3 is often not 10 because the decimal representation loses the repeating .33? In float, you run into the same issue but in much less predictable places.