Rounding modes and exception flags

Chapter 9 explained the behavior of the rounding modes and error flags. The enumeration EFPRoundingDirection names the rounding modes: kFPToNearest, kFPUpward, kFPDownward, and kFPTowardZero. The enumeration EFPException names the flags: kFPInexact, kFPDivideByZero, kFPUnderflow, kFPOverflow, and kFPInvalid.

The class TFPExceptionSet simplifies the manipulation of multiple error flags. Its constructor creates an object containing any combination of enum elements corresponding to the five flags. Member functions provide the protocol of mathematical sets:

TFPExceptionSet is a class specific to numerical computation. It is not derived from TSetOf, as described in Collections, which has a significantly richer protocol.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker