isgreater
提供: cppreference.com
ヘッダ <math.h> で定義
|
||
#define isgreater(x, y) /* implementation defined */ |
(C99以上) | |
浮動小数点数値 x
が浮動小数点数値 y
よりも大きいかどうか、浮動小数点例外を設定せずに判定します。
目次 |
[編集] 引数
x | - | 浮動小数点値 |
y | - | 浮動小数点値 |
[編集] 戻り値
x > y であれば非ゼロの整数値、そうでなければ 0。
[編集] ノート
浮動小数点数値に対する組み込みの > 演算子は一方または両方の引数が NaN であれば FE_INVALID を発生する場合があります。 この関数は > 演算子の「quiet」バージョンです。
[編集] 例
Run this code
#include <stdio.h> #include <math.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