Unit Conversion Errors Have Crashed Spacecraft (And Probably Your Code)
In 1999, NASA's Mars Climate Orbiter burned up in the Martian atmosphere because one team used pound-force seconds and another team used newton-seconds. A $125 million spacecraft destroyed by a uni...

Source: DEV Community
In 1999, NASA's Mars Climate Orbiter burned up in the Martian atmosphere because one team used pound-force seconds and another team used newton-seconds. A $125 million spacecraft destroyed by a unit conversion error. The software worked perfectly. The units were wrong. This is the most expensive unit conversion bug in history, but smaller versions happen constantly in software engineering. API returns data in meters, your code assumes feet. A database stores weight in kilograms, the UI displays pounds without conversion. A recipe calls for 350 degrees and you don't check whether it means Fahrenheit or Celsius. Why unit bugs are so dangerous Unit conversion errors are uniquely dangerous because: They compile and run. A number is a number to the computer. It does not know or care whether 350 represents degrees Fahrenheit or degrees Celsius. There is no type error, no runtime exception, no warning. They produce plausible results. Converting 100 kg to pounds by multiplying by 2 (instead of