std:: islessgreater
|
定义于头文件
<cmath>
|
||
| (1) | ||
|
bool
islessgreater
(
float
x,
float
y
)
;
bool
islessgreater
(
double
x,
double
y
)
;
|
(C++11 起)
(C++23 前) |
|
|
constexpr
bool
islessgreater
(
/* 浮点类型 */
x,
/* 浮点类型 */ y ) ; |
(C++23 起) | |
|
定义于头文件
<cmath>
|
||
|
template
<
class
Arithmetic1,
class
Arithmetic2
>
bool islessgreater ( Arithmetic1 x, Arithmetic2 y ) ; |
(A) |
(C++11 起)
(C++23 起为 constexpr) |
目录 |
参数
| x, y | - | 浮点数或整数值 |
返回值
当 x < y || x > y 时返回 true ,否则返回 false 。
注释
内置的 operator < 和 operator > 对于浮点数,若一个或两个参数为 NaN 时可能引发 FE_INVALID 。此函数是表达式 x < y || x > y 的“静默”版本。
额外的重载不需要完全按照 (A) 的形式提供。只需确保对于它们的第一个参数 num1 和第二个参数 num2 满足以下条件:
|
(C++23 前) |
|
若
num1
和
num2
具有算术类型,则
std
::
islessgreater
(
num1, num2
)
与
std
::
islessgreater
(
static_cast
<
/*common-floating-point-type*/
>
(
num1
)
,
若不存在具有最高等级和子等级的此类浮点类型,则 重载决议 不会从提供的重载中得到可用候选。 |
(C++23 起) |
参见
|
(C++11)
|
检查第一个浮点参数是否小于第二个
(函数) |
|
(C++11)
|
检查第一个浮点参数是否大于第二个
(函数) |
|
C 文档
for
islessgreater
|
|