描述:
计算 x 与 y 平方和的平方根。
定义:
float hypot ( float x, float y );
float hypotf( float x, float y );
double hypot ( double x, double y );
long double hypot ( long double x, long double y );
long double hypotl( long double x, long double y );
float hypot ( float x, float y, float z );
double hypot ( double x, double y, double z );
long double hypot ( long double x, long double y, long double z );
示例:
#include <iostream>
int main(int argc, char **argv)
{
//计算3与4平方和的平方根
double dValue = std::hypot(3,4);
std::cout << dValue << std::endl;//5
return 0;
}