Mathematics I / Floating-Point Numbers
Practice question · Multiple choice

In 1996 the Ariane 5 rocket destroyed itself 37 seconds after launch, from converting a 64-bit float to a 16-bit integer that overflowed. What is the general lesson?

Hints
  1. The code had flown successfully for years. Ask what changed.
  2. The value that overflowed was horizontal velocity. What was different about Ariane 5?
Show the answer

C. That representable range is part of a program's contract

Why

The software was correct, for Ariane 4. A faster rocket produced a velocity outside the 16-bit range, and reuse carried the code across without re-checking its assumptions. Range is part of the contract, and 370 million dollars was the cost of an implicit precondition.

Read the lesson: Floating-Point Numbers →

Practise Floating-Point Numbers

The app has 6 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.

More questions on Floating-Point Numbers