Share via


signbit

Bestimmt, ob ein Gleitkommawert negativ ist.

Syntax

int signbit(
   /* floating-point */ x
); /* C-only macro */

inline bool signbit(
   float x
) throw(); /* C++-only overloaded function */

inline bool signbit(
   double x
) throw(); /* C++-only overloaded function */

inline bool signbit(
   long double x
) throw(); /* C++-only overloaded function */

Parameter

x
Der zu testende Gleitkommawert.

Rückgabewert

signbit gibt einen Wert ungleich Null (true in C++) zurück, wenn das Argument x negativ oder negativ unendlich ist. Es gibt 0 (false in C++) zurück, wenn das Argument nicht negativ, positive Unendlichkeit oder NAN ist.

Hinweise

signbit ist ein Makro, wenn es als C kompiliert wird, und eine überladene Inlinefunktion, wenn sie als C++ kompiliert wird.

Anforderungen

Funktion Erforderlicher Header (C) Erforderlicher Header (C++)
signbit <math.h> <math.h> oder <cmath>

Weitere Informationen zur Kompatibilität finden Sie unter Kompatibilität.

Siehe auch

Mathematische und Gleitkommaunterstützung
isfinite, _finite, _finitef
isinf
isnan, _isnan, _isnanf
isnormal
_fpclass, _fpclassf