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
Défini dans l'en-tête <math.h>
#define isgreater(x, y) /* implementation defined */
(depuis C99)

Détermine si le nombre à virgule flottante x est supérieur au nombre à virgule flottante ( y ), sans déclencher d'exceptions à virgule flottante.

Table des matières

Paramètres

x - valeur à virgule flottante
y - valeur à virgule flottante

Valeur de retour

Valeur intégrale non nulle si x > y , 0 sinon.

Notes

L'opérateur intégré operator > pour les nombres à virgule flottante peut définir FE_INVALID si un ou les deux arguments sont NaN. Cette fonction est une version "silencieuse" de operator > .

Exemple

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

Sortie possible :

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

Références

  • Norme C23 (ISO/CEI 9899:2024) :
  • 7.12.14.1 La macro isgreater (p: TBD)
  • F.10.11 Macros de comparaison (p: TBD)
  • Norme C17 (ISO/CEI 9899:2018):
  • 7.12.14.1 La macro isgreater (p: 189)
  • F.10.11 Macros de comparaison (p: 386-387)
  • Norme C11 (ISO/CEI 9899:2011) :
  • 7.12.14.1 La macro isgreater (p: 259)
  • F.10.11 Macros de comparaison (p: 531)
  • Norme C99 (ISO/CEI 9899:1999) :
  • 7.12.14.1 La macro isgreater (p: 240)

Voir aussi

(C99)
vérifie si le premier argument à virgule flottante est inférieur au second
(macro de fonction)
Documentation C++ pour isgreater