The objective of floating-point rounding is an approximation of an arbitrary real number by one that is representable with respect to a given floating-point format. We define a rounding mode to be a mapping such that for all , , and , the following axioms are satisfied:
In the first two sections of this chapter, we examine the two basic rounding modes RTZ (“round toward 0”) and RAZ ('round away from 0”), characterized by the inequalities
Considerations other than -exactness are involved in the rounding of results that lie outside of the normal range of a format. In the case of overflow, which occurs when the result of a computation exceeds the representable range, the standard prescribes rounding either to the maximum representable number or to infinity. The rules that govern this choice, which are quite arbitrary from a mathematical perspective, are deferred to Part III. The more interesting case of underflow, involving a non-zero result that lies below the normal range, is the subject of Section 6.6.