Compartir a través de


isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered

Determina la relación de ordenación entre dos valores de punto flotante.

Sintaxis

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 */

Parámetros

x, y
Valores de punto flotante que se van a comparar.

Valor devuelto

En todas las comparaciones, los infinitos del mismo signo se comparan como iguales. Infinito negativo es menor que cualquier valor finito o infinito positivo. Infinito positivo es mayor que cualquier valor finito o infinito negativo. Los ceros son iguales, independientemente del signo. Los naN no son menores, iguales o mayores que ningún valor, incluido otro NaN.

Cuando ninguno de los argumentos es naN, las macros isgreaterde ordenación , isgreaterequal, islessy islessequal devuelven un valor distinto de cero si la relación de ordenación especificada entre x y y contiene true. Estas macros devuelven 0 si uno o ambos argumentos son NaN o si la relación de ordenación es false. Los formularios de función se comportan del mismo modo, pero devuelven true o false.

La islessgreater macro devuelve un valor distinto de cero si ambos x y y no son NaN, y x es menor que o mayor que y. Devuelve 0 si uno o ambos argumentos son NaN o si los valores son iguales. El formulario de función se comporta de la misma forma, pero devuelve true o false.

La isunordered macro devuelve un valor distinto de cero si x, yo ambos son NaN. De lo contrario, devuelve 0. El formulario de función se comporta de la misma forma, pero devuelve true o false.

Comentarios

Estas operaciones de comparación se implementan como macros cuando se compilan como C y como funciones de plantilla en línea cuando se compilan como C++.

Requisitos

Función Encabezado necesario (C) Encabezado necesario (C++)
isgreater, isgreaterequal, isless,
islessequal, islessgreater, isunordered
<math.h> <math.h> o <cmath>

Para obtener más información sobre compatibilidad, consulte Compatibilidad.

Consulte también

Compatibilidad con matemáticas y punto flotante
isfinite, _finite, _finitef
isinf
isnan, _isnan, _isnanf
_fpclass, _fpclassf