Floating-point arithmetic: Difference between revisions

Content deleted Content added
Incidents: Clarify. Change "error" since the earlier text no longer uses that word.
Incidents: Adjust phrasing after discussion on talk page: https://en.wikipedia.org/wiki/Talk:Floating-point_arithmetic#c-Vincent_Lef%C3%A8vre-20250717123000-Taylor_Riastradh_Campbell-20250717041600 Is this better?
Line 575:
 
=== Incidents ===
* On 25 February 1991, a [[loss of significance]] in a [[MIM-104 Patriot]] missile battery [[MIM-104 Patriot#Failure at Dhahran|prevented it from intercepting]] an incoming [[Al Hussein (missile)|Scud]] missile in [[Dhahran]], [[Saudi Arabia]], contributing to the death of 28 soldiers from the U.S. Army's [[14th Quartermaster Detachment]].<ref name="GAO report IMTEC 92-26"/> The weapons control computer counted time in an integer number of tenths of a second since boot. For conversion to a floating-point number of seconds in velocity and position calculations, the software originally multiplied this number by a 24-bit [[Fixed-point arithmetic|fixed-point]] binary approximation to 0.1, specifically <math display="block">0.00011001100110011001100_2 = 0.1 \times (1 - 2^{-20}).</math> Some parts of the software were later adapted to use a more accurate conversion to floating-point, but some parts were not updated and still used the 24-bit approximation.<ref name="Skeel"/> These parts of the software drifted from one another by about 3.43&nbsp;milliseconds per hour. After 20 hours, the discrepancy of about 68.7&nbsp;ms was enough for the radar tracking system to lose track of Scuds; the control system in the Dhahran missile battery had been running for about 100 hours when it failed to track and intercept an incoming Scud.<ref name="GAO report IMTEC 92-26"/> The failure to intercept arose not from the use ofusing floating-point, but from the use ofsubtracting two different approximations to unit conversionsconversion with different errors when representing time, so the unit conversion error in differentthe difference didn't cancel out but rather partsgrew ofindefinitely awith calculationuptime.<ref name="Skeel"/>
* {{Clarify|date=November 2024|reason=It is not clear how this is an incident (the section title may have to be modified to cover more than incidents) and how this is due to floating-point arithmetic (rather than number approximations in general). The term "invisible" may also be misleading without following explanations. |text=[[Salami slicing tactics#Financial schemes|Salami slicing]] is the practice of removing the 'invisible' part of a transaction into a separate account.}}