_clear87, _clearfp

Aus RAD Studio
Wechseln zu: Navigation, Suche

Nach oben zu Float.h - Index


Header-Datei

float.h

Prototyp

unsigned int _clear87 (void);
unsigned int _clearfp (void);

Beschreibung

Löscht das Gleitkommastatuswort.

_clear87 löscht das Gleitkommastatuswort, wobei es sich um eine Kombination des 80x87-Statusworts und anderer Bedingungen handelt, die von der Behandlungsroutine für 80x87-Exceptions erkannt werden.

_clearfp ist mit _clear87 identisch und dient der Microsoft-Kompatibilität.

Rückgabewert

Die Bits im zurückgegebenen Wert geben den Gleitkommastatus an, bevor dieser gelöscht wurde. Weitere Informationen zum Statuswort enthalten die in float.h definierten Konstanten.

Portabiltät

POSIX ANSI C ANSI C++ Win32 Win64 macOS
_clear87 +
_clearfp +

Beispiel

#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;
}