Robert Fisher

Just thinking out loud

On floating point

If you register and log in you can add comments to my pages. If viewing the main blog page, click the # underneath an entry to comment on it.

A quote from FloatingPointFractions on c2.com:

“every floating point number is an approximation of an infinite number of nearby non-rational real numbers”


Side note: so-called “banker's rounding” rounds x.5 to the nearest even integer.

  • 0.4 → 0
  • 0.5 → 0
  • 0.6 → 1
  • 1.4 → 1
  • 1.5 → 2
  • 1.6 → 2
  • 2.4 → 2
  • 2.5 → 2
  • 2.6 → 3
  • 3.4 → 3
  • 3.5 → 4