Author Topic: A visual example of floating point numbers and their limitations  (Read 1071 times)

0 Members and 1 Guest are viewing this topic.

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs


A practical example, too -- floats are used in many games, this one for example!

The abstract lesson is: floating point math is unstable, in sometimes unexpected ways.  You can't increment a float, not for very long (some millions of times).  While you can write an expression in any equivalent mathematical form, some forms are better-behaved than others when it comes to hard numbers.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: abraxalito, Smokey, Airmann90


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf