Ariane 5 Rocket Explodes 37 Seconds After Launch Due to Integer Overflow

What happened
The maiden flight of the Ariane 5 rocket ended in self-destruction 37 seconds after launch. A 64-bit floating-point value representing horizontal velocity was converted to a 16-bit integer, overflowing and crashing the inertial reference system. The backup system had the same bug and failed identically.[1]
What went wrong
Software from the Ariane 4 was reused in Ariane 5 without verifying that the same assumptions held. The horizontal velocity in Ariane 5's higher-energy trajectory exceeded the range the conversion could handle — a scenario that was never tested because Ariane 4 never reached those velocities.[1]
Lesson learned
Software reuse across systems with different operational envelopes is high-risk. Exception handling must be required in safety-critical code — the system crashed because an unhandled exception propagated to the flight computer. Assumptions embedded in code must be documented and re-validated.