double
copysign(double x, double y)
{
/ use atan2 to distinguish -0 from 0 /
if (y > 0 || (y == 0 && atan2(y, -1) > 0)) {
return fabs(x);
} else {
return -fabs(x);
}
}
#endif / HAVE_COPYSIGN /
#ifndef HAVE_ROUND
double
round(double x)
{
double absx, y;
absx = fabs(x);
y = floor(absx);
if (absx - y >= 05)
y += 10;
return copysign(y, x);
}
#endif / HAVE_ROUND /
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)