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
Definiert in Header <math.h>
#define isgreater(x, y) /* implementation defined */
(seit C99)

Bestimmt, ob die Gleitkommazahl x größer als die Gleitkommazahl ( y ) ist, ohne Gleitkomma-Ausnahmen auszulösen.

Inhaltsverzeichnis

Parameter

x - Gleitkommawert
y - Gleitkommawert

Rückgabewert

Ein von Null verschiedener ganzzahliger Wert, wenn x > y , 0 andernfalls.

Hinweise

Der eingebaute operator > für Gleitkommazahlen kann FE_INVALID setzen, wenn eines oder beide Argumente NaN ist. Diese Funktion ist eine "ruhige" Version von operator > .

Beispiel

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

Mögliche Ausgabe:

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

Referenzen

  • C23-Standard (ISO/IEC 9899:2024):
  • 7.12.14.1 The isgreater macro (p: TBD)
  • F.10.11 Comparison macros (p: TBD)
  • C17-Standard (ISO/IEC 9899:2018):
  • 7.12.14.1 The isgreater macro (S. 189)
  • F.10.11 Vergleichsmakros (S. 386-387)
  • C11-Standard (ISO/IEC 9899:2011):
  • 7.12.14.1 Die isgreater-Makro (S: 259)
  • F.10.11 Vergleichsmakros (S: 531)
  • C99-Standard (ISO/IEC 9899:1999):
  • 7.12.14.1 Die isgreater-Makro (S: 240)

Siehe auch

(C99)
prüft, ob das erste Gleitkomma-Argument kleiner als das zweite ist
(Funktionsmakro)
C++-Dokumentation für isgreater