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 в противном случае.

Примечания

Встроенный operator > для чисел с плавающей запятой может устанавливать FE_INVALID если один или оба аргумента являются NaN. Данная функция является "тихой" версией operator > .

Пример

#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 Макрос isgreater (стр.: TBD)
  • F.10.11 Макросы сравнения (стр.: TBD)
  • Стандарт C17 (ISO/IEC 9899:2018):
  • 7.12.14.1 Макрос isgreater (стр. 189)
  • F.10.11 Макросы сравнения (стр. 386-387)
  • Стандарт C11 (ISO/IEC 9899:2011):
  • 7.12.14.1 Макрос isgreater (стр. 259)
  • F.10.11 Макросы сравнения (стр. 531)
  • Стандарт C99 (ISO/IEC 9899:1999):
  • 7.12.14.1 Макрос isgreater (стр. 240)

Смотрите также

(C99)
проверяет, является ли первый аргумент с плавающей точкой меньше второго
(макрос функции)
C++ documentation для isgreater