#include <math.h>
double log10( double num );
函数返回参数 num 以 10 为底的对数。如果 num 为负,产生域错误。如果 num 为零,产生范围错误。
#include <math.h> #include <stdio.h> int main(void) { double result; double x = 800.6872; result = log10(x); printf("The common log of %lf is %lf\n", x, result); return 0; }
输出结果:
The common log of 800.687200 is 2.903463