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. |