isgreaterequal
From cppreference.com
| ヘッダー <math.h> で定義 |
||
| #define isgreaterequal(x, y) /* 実装定義 */ |
(C99以降) | |
浮動小数点数 x が浮動小数点数 y 以上であるかを、浮動小数点例外を設定せずに判定します。
目次 |
[編集] パラメータ
| x | - | floating-point value |
| y | - | floating-point value |
[編集] 戻り値
x >= y の場合はゼロ以外の整数値、それ以外の場合は 0。
[編集] 注記
浮動小数点数に対する組み込みの operator>= は、引数のいずれか一方または両方が NaN の場合に FE_INVALID を発生させる可能性があります。この関数は operator>= の「静かな」バージョンです。
[編集] 例
このコードを実行
#include <math.h> #include <stdio.h> int main(void) { printf("isgreaterequal(2.0,1.0) = %d\n", isgreaterequal(2.0, 1.0)); printf("isgreaterequal(1.0,2.0) = %d\n", isgreaterequal(1.0, 2.0)); printf("isgreaterequal(1.0,1.0) = %d\n", isgreaterequal(1.0, 1.0)); printf("isgreaterequal(INFINITY,1.0) = %d\n", isgreaterequal(INFINITY, 1.0)); printf("isgreaterequal(1.0,NAN) = %d\n", isgreaterequal(1.0, NAN)); return 0; }
実行結果の例
isgreaterequal(2.0,1.0) = 1 isgreaterequal(1.0,2.0) = 0 isgreaterequal(1.0,1.0) = 1 isgreaterequal(INFINITY,1.0) = 1 isgreaterequal(1.0,NAN) = 0
[編集] 参考文献
- C23標準 (ISO/IEC 9899:2024)
- 7.12.14.2 The isgreaterequal macro (p: TBD)
- F.10.11 Comparison macros (p: TBD)
- C17標準 (ISO/IEC 9899:2018)
- 7.12.14.2 The isgreaterequal macro (p: TBD)
- F.10.11 Comparison macros (p: TBD)
- C11標準 (ISO/IEC 9899:2011)
- 7.12.14.2 The isgreaterequal macro (p: 259-260)
- F.10.11 Comparison macros (p: 531)
- C99標準 (ISO/IEC 9899:1999)
- 7.12.14.2 The isgreaterequal macro (p: 240-241)
[編集] 関連項目
| (C99) |
最初の浮動小数点数引数が2番目以下かチェックする (関数マクロ) |
| C++ ドキュメント (isgreaterequal)
| |