Open GoogleCodeExporter opened 8 years ago
新建个 .cc 的文件, 自己实现一个 hypot 函数:
extern double fabs(double);
extern double sqrt(double);
#ifdef __cplusplus
extern "C" {
double hypot(double x, double y) {
double ax = fabs(x), ay = fabs(y);
double xy = x/y, yx = y/x;
return ax > ay
? ax * sqrt(1.0 + yx*yx)
: ay * sqrt(1.0 + xy*xy);
}
}
#endif // __cplusplus
Original comment by aday...@gmail.com
on 15 Mar 2015 at 6:49
Original issue reported on code.google.com by
tanningz...@gmail.com
on 5 Feb 2015 at 3:05