hypot
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <math.h> 中定义
|
||
| float hypotf( float x, float y ); |
||
| double hypot( double x, double y ); |
||
| long double hypotl( long double x, long double y ); |
||
计算
x和y的平方的总和的平方根,没有不当的上溢或下溢,在中间阶段的计算。这是一个边长的直角三角形的斜边的长度xy,或距离的点(x,y)从原点(0,0),或一个复数x+iy的幅度原文:
Computes the square root of the sum of the squares of
x and y, without undue overflow or underflow at intermediate stages of the computation. This is the length of the hypotenuse of a right-angled triangle with sides of length x and y, or the distance of the point (x,y) from the origin (0,0), or the magnitude of a complex number x+iy目录 |
[编辑] 参数
| x | - | 浮点值
|
| y | - | 浮点值
|
[编辑] 返回值
一个直角三角形的斜边,√x2
+y2
.
+y2
.
原文:
The hypotenuse of a right-angled triangle, √x2
+y2
.
+y2
.
[编辑] 例外
如果结果溢出,范围可能发生错误,FE_OVERFLOW可能会引发.
原文:
If the result overflows, a range error may occur and FE_OVERFLOW may be raised.
如果结果是次正规,下溢错误,可能会发生与FE_UNDERFLOW可能提出.
原文:
If the result is subnormal, an underflow error may occur and FE_UNDERFLOW may be raised.
[编辑] 注释
典型的执行战略是计算相当于u√1+(
)2
地方
| v |
| u |
地方
umax(x,y)和v是min(x,y).原文:
Typical implementation strategy is to calculate an equivalent of u√1+(
)2
where
| v |
| u |
where
u is max(x,y) and v is min(x,y).[编辑] 示例
| 本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
| 计算平方根(√x) (函数) | |
| 引起了一些给定的功率(xy) 原文: raises a number to the given power (xy) (函数) | |
| C++ documentation for hypot
| |