C 标准库——

std:pow()

xy

double pow(double _X, double _Y);

std::fabs() vs std::abs()

In C++, it’s always sufficient to use std::abs; it’s overloaded for all the numerical types.

C++,已对std::abs()所有数值类型做过重载;

In C, abs only works on integers, and you need fabs for floating point values. These are available in C++ (along with all of the C library), but there’s no need to use them.

在 C 中,abs()只作用于整型数据,fabs()自然对于浮点数类型

你可能感兴趣的:(C 标准库——)