A divide-by-zero exception occurs when the program attempts to divide a finite non-zero number by zero.
FE_INEXACT
An inexact exception is raised whenever there is a loss of precision due to rounding.
FE_INVALID
Invalid operation exceptions occur when a program attempts to perform calculations for which there is no reasonable representable answer. For instance, subtraction of infinities, division of zero by zero, ordered comparison involving NaNs, and taking the square root of a negative number are all invalid operations.
FE_OVERFLOW
An overflow exception occurs when the magnitude of the result of a computation is too large to fit in the destination type.
FE_UNDERFLOW
Underflow occurs when the result of a computation is too close to zero to be represented as a non-zero value in the destination type.
Additionally, the FE_ALL_EXCEPT macro expands to the bitwise OR of the above flags and any architecture-specific flags. Combinations of these flags are passed to the feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, and fetestexcept functions to clear, save, raise, restore, and examine the processors floating-point exception flags, respectively.
Exceptions may be unmasked with feenableexcept and masked with fedisableexcept. Unmasked exceptions cause a trap when they are produced, and all exceptions are masked by default. The current mask can be tested with fegetexcept.
Results are rounded to the closest representable value. If the exact result is exactly half way between two representable values, the value whose last binary digit is even (zero) is chosen. This is the default mode.
FE_DOWNWARD
Results are rounded towards negative If].
FE_UPWARD
Results are rounded towards positive If].
FE_TOWARDZERO
Results are rounded towards zero.
The fegetround and fesetround functions query and set the rounding mode.