Back to articles
Why Speed Conversion Bugs Cause Real Engineering Failures
NewsTools

Why Speed Conversion Bugs Cause Real Engineering Failures

via Dev.to BeginnersMichael Lip

In 1999, NASA lost the Mars Climate Orbiter because one team used imperial units and another used metric. The spacecraft entered the Martian atmosphere at the wrong angle and disintegrated. A $327 million mission, destroyed by a unit conversion error. Most of us are not sending probes to Mars, but unit conversion mistakes still cause real problems in software. The conversion factors Kilometers per hour to miles per hour: mph = kmh * 0.621371 Miles per hour to kilometers per hour: kmh = mph * 1.60934 Those two numbers, 0.621371 and 1.60934, are the only constants you need. They are exact reciprocals of each other (within rounding). Memorize either one and you can derive the other. The mental math shortcut If you need a rough conversion and don't have a calculator handy, here is the trick I use: multiply by 0.6 for km/h to mph, or multiply by 1.6 for mph to km/h. 100 km/h is roughly 60 mph. 60 mph is roughly 96 km/h. Close enough for everyday use. For even faster estimation, divide by 8

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
7 views

Related Articles