Computer Bugs - Roundoff Error and the Patriot Missile
0.10
During the Gulf War in 1991, a U.S. Patriot missile failed to intercept an
Iraqi Scud missile, and 28 Americans were killed.
A later study determined that the problem was caused by the inaccuracy of the binary representation of 0.10.
The Patriot incremented a counter once every 0.10 seconds.
It multiplied the counter value by 0.10 to compute the actual time. However, the (24-bit) binary representation of 0.10 actually corresponds to 0.099999904632568359375, which is off by 0.000000095367431640625.
This doesn’t seem like much, but after 100 hours the time ends up being off by 0.34 seconds—enough time for a Scud to travel 500 meters!
Professor Skeel wrote a short article about this.