std::isgreater
来自 cppreference.cn
定义于头文件 <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
|