isgreater
, isgreaterequal
, isless
, islessequal
, islessgreater
, isunordered
2 つの浮動小数点値の間の順序付け関係を判別します。
構文
int isgreater(
/* floating-point */ x,
/* floating-point */ y
); /* C-only macro */
int isgreaterequal(
/* floating-point */ x,
/* floating-point */ y
); /* C-only macro */
int isless(
/* floating-point */ x,
/* floating-point */ y
); /* C-only macro */
int islessequal(
/* floating-point */ x,
/* floating-point */ y
); /* C-only macro */
int islessgreater(
/* floating-point */ x,
/* floating-point */ y
); /* C-only macro */
int isunordered(
/* floating-point */ x,
/* floating-point */ y
); /* C-only macro */
template <class FloatingType1, class FloatingType2>
inline bool isgreater(
FloatingType1 x,
FloatingType2 y
) throw(); /* C++-only template function */
template <class FloatingType1, class FloatingType2>
inline bool isgreaterequal(
FloatingType1 x,
FloatingType2 y
) throw(); /* C++-only template function */
template <class FloatingType1, class FloatingType2>
inline bool isless(
FloatingType1 x,
FloatingType2 y
) throw(); /* C++-only template function */
template <class FloatingType1, class FloatingType2>
inline bool islessequal(
FloatingType1 x,
FloatingType2 y
) throw(); /* C++-only template function */
template <class FloatingType1, class FloatingType2>
inline bool islessgreater(
FloatingType1 x,
FloatingType2 y
) throw(); /* C++-only template function */
template <class FloatingType1, class FloatingType2>
inline bool isunordered(
FloatingType1 x,
FloatingType2 y
) throw(); /* C++-only template function */
パラメーター
x
, y
比較する浮動小数点値。
戻り値
すべての比較において、同じ符号の無限大は等しいものとして比較されます。 負の無限大は、有限値または正の無限大より小さい値です。 正の無限大は、有限値または負の無限大より大きい値です。 ゼロは符号に関係なく等しくなります。 NaN は、別の NaN を含め、任意の値より小さい、等しい、または大きい値ではありません。
どちらの引数も NaN でない場合、順序付けマクロ isgreater
(,isgreaterequal
) isless
は、islessequal
指定された順序関係x
y
が true の場合は 0 以外の値を返します。 これらのマクロでは、いずれかの引数または両方の引数が NaN の場合、または順序関係が偽である場合、0 を返します。 関数形式も同様に動作しますが、true
または false
が返されます。
このマクロは islessgreater
、両方とも x
y
NaN ではない場合は 0 以外の値を返し x
、次の値より小さいか大きい y
かのいずれかです。 いずれかの引数または両方の引数が NaN の場合、または値が等しい場合、0 が返されます。 関数形式も同様に動作しますが、true
または false
が返 されます。
または両方が NaN の場合x
y
、マクロは isunordered
0 以外の値を返します。 それ以外の場合は 0 を返します。 関数形式も同様に動作しますが、true
または false
が返 されます。
解説
これらの比較操作は、C としてコンパイルする場合はマクロとして実装され、C++ としてコンパイルする場合はインライン テンプレート関数として実装されます。
必要条件
機能 | 必須ヘッダー (C) | 必須ヘッダー (C++) |
---|---|---|
isgreater , isgreaterequal , isless ,islessequal , islessgreater , isunordered |
<math.h> | <math.h> または <cmath> |
互換性の詳細については、「 Compatibility」を参照してください。
関連項目
数学と浮動小数点のサポート
isfinite
, _finite
, _finitef
isinf
isnan
, _isnan
, _isnanf
_fpclass
, _fpclassf
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示