- C 标准库—— string.h
- C 标准库 —— time.h
- C 标准库 —— limits.h
- C 标准库 —— stdio.h
- C 标准库—— stdlib.h(包括 rand srand 的实现)
- C 标准库——<cmath>/<math.h>
- C 标准库—— assert.h
1. std:pow()
xy
double pow(double _X, double _Y);
2. 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()自然对于浮点数类型。
1. abs()
long double abs(long double _X);
float abs(float _X);
double abs(double _X);
int abs(int _X);
2. fabs()
三种参数类型的重载:
- (1)long double
- (2)float
- (3)double