Skip to main content
1 of 8
Steve Barnes
  • 5.3k
  • 1
  • 18
  • 19

I can give you an example of an corner case that could never occur that caused a disaster.

When the Ariane 4 was being developed the values from the lateral accellerometers were scaled to fit into a signed integer and because the maximum possible output of the accellerometers, when scaled, could never exceed exceed 32768 and the minimum could never fall below -32768 there was "no need for the overhead of range checking. In general all inputs are supposed to be range checked before any conversion but in this case that would be trying to catch in impossible corner case.

Several years later the Ariane 5 was being developed and the code for scaling the lateral accellerometers was reused with minimal testing as it was "proven in use" unfortunately the larger rocket could expect larger lateral accellerations so the accellerometers were upgraded and could produce larger 64 bit float values.

These larger values "wrapped" in the conversion code, remember no range checking, and the results on the first launch in 2002 weren't good, cost the company millions and caused a major hiatus in the program.

enter image description here

Steve Barnes
  • 5.3k
  • 1
  • 18
  • 19