std::copysign
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <cmath> 中定义
|
||
| float copysign( float x, float y ); |
(1) | (C++11 起) |
| double copysign( double x, double y ); |
(2) | (C++11 起) |
| long double copysign( long double x, long double y ); |
(3) | (C++11 起) |
| Promoted copysign( Arithmetic x, Arithmetic y ); |
(4) | (C++11 起) |
x的大小和符号的y组成一个浮点值. 原文:
Composes a floating point value with the magnitude of
x and the sign of y. 如果任何参数是整数类型,它被转换为double。如果有另一种说法是long double,则返回类型是long double,否则它是double.
原文:
If any argument has integral type, it is cast to double. If any other argument is long double, then the return type is long double, otherwise it is double.
[编辑] 参数
| x, y | - | 浮点值
|
[编辑] 返回值
浮点值与幅度的
x和y迹象原文:
floating point value with the magnitude of
x and the sign of y[编辑] 另请参阅
| 一个浮点值的绝对值(|x|) 原文: absolute value of a floating point value (|x|) (函数) | |
| (C++11) |
给定数量的检查,如果是否定的 原文: checks if the given number is negative (函数) |