Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 8 - Environmental Control Functions / Accessing the Floating-Point Environment


fegetenv

You can use the fegetenv function to save the current state of the floating-point environment.

void fegetenv (fenv_t *envp);
envp
A pointer to an environment word that will store the current state of the environment upon the function's return.
DESCRIPTION
The fegetenv function saves the current state of the rounding direction modes and the floating-point exception flags in the object pointed to by its envp argument.

EXAMPLES
double_t func (double_t x, double_t y)
{
   fenv_t *env;

   x = x + y;        /* floating-point op; may raise exceptions */
   fegetenv(env);    /* save state of env after add */

   y = y * x;        /* floating-point op; may raise exceptions */
   .
   .
   .
}

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996