【C语言库函数源代码】
【本程序在Dev C++ 4.9.9.2 下编译通过】
/*
hypot函数对于给定的直角三角形的两个直角边,
求其斜边的长度。
*/
//一般的常规算法:
double my_hypot01(double x, double y)
{
double hypotenuse;
x = fabs(x);
y = fabs(y);
if (x < y)
{
double temp = x;
x = y;
y = temp;
}
if (x == 0.)
return 0.;
else
{
hypotenuse = y/x;
return