double hypot (double x , double y); float hypotf (float x , float y);long double hypotl (long double x, long double y);
double hypot (double x , double y); float hypot (float x , float y);long double hypot (long double x, long double y); double hypot (Type1 x , Type2 y); // additional overloads
<cmath>
)还提供了其他算术类型的重载(Type1 和 Type2):这些重载实际上会将参数转换为 double
类型进行计算,除非至少有一个参数是 long double
类型(在这种情况下,两者都会被转换为 long double
)。(x2+y2)
的平方根。
|
|
3.000000, 4.000000 and 5.000000 form a right-angled triangle. |