Abstract
The use of floating-point computations for the implementation of critical systems is perceived as increasingly acceptable. Even in modern avionics, one of the most critical domains for software, floating-point numbers are now used, more often than not, instead of fixed-point arithmetic. However, designing and testing floating-point algorithms is significantly more difficult than designing and testing integer algorithms. Acceptance of floating-point computations in the design of critical systems was facilitated by the widespread adoption of significant portions of the IEEE 754 standard for binary floating-point arithmetic: nonetheless, many highly-complex traps and pitfalls remain. In this seminar, we will present examples showing how things can go spectacularly wrong with floating-point numbers. We will then introduce the IEEE 754 binary floating-point formats, including NaNs, signed zeroes, infinities and subnormals, along with the reasons they are there. We will introduce the IEEE 754 rounding modes, with an emphasis on round-to-nearest tails-to-even, and the properties that floating-expressions do and do not possess. After an introduction to phenomena that are most often undesirable (NaN generation, overflows, underflows, absorption, cancellation, ...), we will present an example algorithm where things go wrong (because the peculiarities of floating-point numbers were not taken into account in the design), and illustrate how to improve the situation.