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
헤더 파일에 정의됨 <math.h>
#define isgreater(x, y) /* implementation defined */
(C99부터)

부동 소수점 숫자 x 가 부동 소수점 숫자 ( y )보다 큰지 여부를 결정하며, 부동 소수점 예외를 설정하지 않습니다.

목차

매개변수

x - 부동소수점 값
y - 부동소수점 값

반환값

x > y 인 경우 0이 아닌 정수 값, 0 그 외의 경우.

참고 사항

부동소수점 숫자에 대한 내장 operator > 는 하나 또는 두 인수가 NaN인 경우 FE_INVALID 를 설정할 수 있습니다. 이 함수는 operator > 의 "quiet" 버전입니다.

예제

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

가능한 출력:

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

참고문헌

  • C23 표준 (ISO/IEC 9899:2024):
  • 7.12.14.1 The isgreater 매크로 (p: TBD)
  • F.10.11 비교 매크로 (p: TBD)
  • C17 표준 (ISO/IEC 9899:2018):
  • 7.12.14.1 isgreater 매크로 (p: 189)
  • F.10.11 비교 매크로 (p: 386-387)
  • C11 표준 (ISO/IEC 9899:2011):
  • 7.12.14.1 isgreater 매크로 (p: 259)
  • F.10.11 비교 매크로 (p: 531)
  • C99 표준 (ISO/IEC 9899:1999):
  • 7.12.14.1 isgreater 매크로 (p: 240)

참고 항목

(C99)
첫 번째 부동 소수점 인수가 두 번째 인수보다 작은지 확인합니다
(함수 매크로)
C++ documentation for isgreater