Namespaces
Variants

isgreater

From cppreference.net
< c ‎ | numeric ‎ | math
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99) (C99) (C99) (C23)
Maximum/minimum operations
Exponential functions
Power functions
Trigonometric and hyperbolic functions
Nearest integer floating-point
(C99) (C99) (C99)
(C23) (C23) (C23) (C23)
Floating-point manipulation
Narrowing operations
(C23)
(C23)
(C23)
(C23)
(C23)
(C23)
Quantum and quantum exponent
Decimal re-encoding functions
Total order and payload functions
Classification
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Types
Macro constants
Special floating-point values
Arguments and return values
Error handling
Fast operation indicators
Definido en el encabezado <math.h>
#define isgreater(x, y) /* implementation defined */
(desde C99)

Determina si el número de punto flotante x es mayor que el número de punto flotante ( y ), sin activar excepciones de punto flotante.

Contenidos

Parámetros

x - valor de punto flotante
y - valor de punto flotante

Valor de retorno

Valor integral distinto de cero si x > y , 0 en caso contrario.

Notas

El operator > incorporado para números de punto flotante puede establecer FE_INVALID si uno o ambos argumentos es NaN. Esta función es una versión "silenciosa" de operator > .

Ejemplo

#include <math.h>
#include <stdio.h>
int main(void)
{
    printf("isgreater(2.0,1.0)      = %d\n", isgreater(2.0, 1.0));
    printf("isgreater(1.0,2.0)      = %d\n", isgreater(1.0, 2.0));
    printf("isgreater(INFINITY,1.0) = %d\n", isgreater(INFINITY, 1.0));
    printf("isgreater(1.0,NAN)      = %d\n", isgreater(1.0, NAN));
    return 0;
}

Salida posible:

isgreater(2.0,1.0)      = 1
isgreater(1.0,2.0)      = 0
isgreater(INFINITY,1.0) = 1
isgreater(1.0,NAN)      = 0

Referencias

  • Estándar C23 (ISO/IEC 9899:2024):
  • 7.12.14.1 The isgreater macro (p: TBD)
  • F.10.11 Comparison macros (p: TBD)
  • Estándar C17 (ISO/IEC 9899:2018):
  • 7.12.14.1 La macro isgreater (p: 189)
  • F.10.11 Macros de comparación (p: 386-387)
  • Estándar C11 (ISO/IEC 9899:2011):
  • 7.12.14.1 La macro isgreater (p: 259)
  • F.10.11 Macros de comparación (p: 531)
  • Estándar C99 (ISO/IEC 9899:1999):
  • 7.12.14.1 La macro isgreater (p: 240)

Véase también

(C99)
comprueba si el primer argumento de punto flotante es menor que el segundo
(macro de función)