[Previous]
[Contents]
[Next]

_status87()

return the floating-point status word

Synopsis:

#include <float.h>
unsigned int _status87( void );

Description:

The _status87() function returns the floating-point status word, which is used to record the status of the CPU's floating-point operations.

Returns:

The floating-point status word. The description of this status is found in the <float.h> header file.

Examples:

#include <stdio.h>
#include <float.h>

#define TEST_FPU(x,y) printf( "\t%s " y "\n", \
        ((fp_status & x) ? "  " : "No") )

int main( void )
  {
    unsigned int fp_status;

    fp_status = _status87();

    printf( "80x87 status\n" );
    TEST_FPU( SW_INVALID, "invalid operation" );
    TEST_FPU( SW_DENORMAL, "denormalized operand" );
    TEST_FPU( SW_ZERODIVIDE, "divide by zero" );
    TEST_FPU( SW_OVERFLOW, "overflow" );
    TEST_FPU( SW_UNDERFLOW, "underflow" );
    TEST_FPU( SW_INEXACT, "inexact result" );
    return( EXIT_SUCCESS );
  }

Classification:

Intel

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

_clear87(), _control87(), _fpreset()


[Previous]
[Contents]
[Next]