_clear87, _clearfp

De RAD Studio
Aller à : navigation, rechercher

Remonter à Float.h - Index


Header File

float.h

Category

Math Routines

Prototype

unsigned int _clear87 (void);

unsigned int _clearfp (void);

Description

Clears the floating-point status word.

_clear87 clears the floating-point status word, which is a combination of the 80x87 status word and other conditions detected by the 80x87 exception handler.

_clearfp is identical to _clear87 and is for Microsoft compatibility.

Return Value

The bits in the value returned indicate the floating-point status before it was cleared. For information on the status word, refer to the constants defined in float.h.

Example



 #include <stdio.h>
 #include <float.h>
 int main(void)
 {
    float x;
    double y = 1.5e-100;
    printf("\nStatus 87 before error: %X\n", _status87());
    x = y; /* create underflow and precision loss */
    printf("Status 87 after  error: %X\n", _status87());
    _clear87();
    printf("Status 87 after  clear: %X\n", _status87());
    y = x;
    return 0;
 }



Portability



POSIX Win32 ANSI C ANSI C++

+