Dela via


isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered

Avgör ordningsrelationen mellan två flyttalsvärden.

Syntax

int isgreater(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int isgreaterequal(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int isless(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int islessequal(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int islessgreater(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */

int isunordered(
   /* floating-point */ x,
   /* floating-point */ y
); /* C-only macro */
template <class FloatingType1, class FloatingType2>
inline bool isgreater(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool isgreaterequal(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool isless(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool islessequal(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool islessgreater(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

template <class FloatingType1, class FloatingType2>
inline bool isunordered(
   FloatingType1 x,
   FloatingType2 y
) throw(); /* C++-only template function */

Parametrar

x, y
Flyttalsvärdena som ska jämföras.

Returvärde

I alla jämförelser jämförs infinities av samma tecken som lika. Negativ oändlighet är mindre än något ändlig värde eller positiv oändlighet. Positiv oändlighet är större än något finita värde eller negativ oändlighet. Nolla är lika med oavsett tecken. NaN är inte mindre än, lika med eller större än något värde, inklusive ett annat NaN.

När inget av argumenten är ett NaN isgreaterordningsmakronen , isgreaterequal, islessoch islessequal returnera ett värde som inte är noll om den angivna ordningsrelationen mellan x och y innehåller sant. Dessa makron returnerar 0 om antingen eller båda argumenten är NaN eller om orderrelationen är false. Funktionsformulären fungerar på samma sätt, men returnerar true eller false.

Makrot islessgreater returnerar ett värde som inte är noll om både x och y inte är NaN och x antingen är mindre än eller större än y. Den returnerar 0 om antingen eller båda argumenten är NaN eller om värdena är lika. Funktionsformuläret fungerar på samma sätt, men returnerar true eller false.

Makrot isunordered returnerar ett värde som inte är noll om antingen x, yeller båda är NaN. Annars returneras 0. Funktionsformuläret fungerar på samma sätt, men returnerar true eller false.

Anmärkningar

Dessa jämförelseåtgärder implementeras som makron när de kompileras som C och som infogade mallfunktioner när de kompileras som C++.

Krav

Funktion Obligatoriskt huvud (C) Obligatoriskt huvud (C++)
isgreater, isgreaterequal, isless,
islessequal, islessgreater, isunordered
<math.h> <math.h> eller <cmath>

Mer kompatibilitetsinformation finns i Compatibility.

Se även

Stöd för matematik och flyttalsstöd
isfinite, _finite, _finitef
isinf
isnan, _isnan, _isnanf
_fpclass, _fpclassf