Assume a bit data type your code may contain

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: se, but on most machines the result will either be ÌÅ Ü Û or ÌÅ Ò Û , where Û is the number of bits in an int. Aside: Ariane 5: the high cost of floating-point overflow Converting large floating-point numbers to integers is a common source of programming errors. Such an error had particularly disastrous consequences for the maiden voyage of the Ariane 5 rocket, on June 4, 1996. Just 37 seconds after lift-off, the rocket veered off its flight path, broke up, and exploded. On board the rocket were communication satellites, valued at $500 million. A later investigation [46] showed that the computer controlling the inertial navigation system had sent invalid data to the computer controlling the engine nozzles. Instead of sending flight control information, it had sent a diagnostic bit pattern indicating that, in an effort to convert a 64-bit floating point number into a 16-bit signed integer, an overflow had been encountered. The value that overflowed measured the horizontal velocity of the rocket, which could be more than five times higher tha...
View Full Document

Ask a homework question - tutors are online