hypot
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 定义于头文件 <math.h>
|
||
| float hypotf( float x, float y ); |
(C99 起) | |
| double hypot( double x, double y ); |
(C99 起) | |
| long double hypotl( long double x, long double y ); |
(C99 起) | |
计算
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
.
[编辑] 例外
如果结果溢出,范围可能发生错误,FE_OVERFLOW可能会引发.
如果结果是次正规,下溢错误,可能会发生与FE_UNDERFLOW可能提出.
[编辑] 注释
典型的执行战略是计算相当于u√1+(
)2
地方
| v |
| u |
地方
umax(x,y)和v是min(x,y).[编辑] 示例
| 本节未完成 原因:暂无示例: |
[编辑] 另请参阅
| (C99) (C99) |
计算平方根 (√x) (函数) |
| (C99) (C99) |
计算一个数的给定次幂 (xy) (函数) |
| hypot的 C++ 文档
|

