std::isgreater
來自 cppreference.com
定義於標頭檔案 <cmath> |
||
(1) | ||
bool isgreater( float x, float y ); bool isgreater( double x, double y ); |
(C++11 起) (直至 C++23) |
|
constexpr bool isgreater( /* 浮點型別 */ x, /* 浮點型別 */ y ); |
(C++23 起) | |
定義於標頭檔案 <cmath> |
||
template< class Arithmetic1, class Arithmetic2 > bool isgreater( Arithmetic1 x, Arithmetic2 y ); |
(A) | (C++11 起) (C++23 起為 constexpr) |
1) 確定浮點數 x 是否大於浮點數 y,而不設定浮點異常。 庫為所有 cv 非限定浮點型別提供了過載,作為引數 x 和 y 的型別。(C++23 起)
A) 為所有其他算術型別組合提供了附加過載。
目錄 |
[編輯] 引數
x, y | - | 浮點數或整數值 |
[編輯] 返回值
如果 x > y 為 true,否則為 false。
[編輯] 注意
浮點數的內建 operator> 可能會在其中一個或兩個引數為 NaN 時設定 FE_INVALID。此函式是 operator> 的“靜默”版本。
不需要嚴格按照 (A) 提供額外的過載。它們只需要足以確保對於其第一個引數 num1 和第二個引數 num2
|
(直至 C++23) |
如果 num1 和 num2 具有算術型別,則 std::isgreater(num1, num2) 的效果與 std::isgreater(static_cast</*common-floating-point-type*/>(num1), 如果不存在具有最高等級和次等級的浮點型別,則過載決議不會從提供的過載中產生可用的候選函式。 |
(C++23 起) |
[編輯] 參見
實現 x > y 的函式物件 (類模板) | |
(C++11) |
檢查第一個浮點引數是否小於第二個 (函式) |
C 文件 關於 isgreater
|