读书人

C++中如何表示Log10Ln等对数函数

发布时间: 2013-10-21 17:02:52 作者: rapoo

C++中怎么表示Log10,Ln等对数函数
C++中如何表示Log10,Ln等对数函数新手求教,在C++中怎么表示log10,ln等对数函数,在网上搜索说Ln直接用log表示对吗,需要include那个头文件
[解决办法]
自己查文档啊。
其它任意底的log,都可以用log(x)/log(底)凑出来。
[解决办法]
#include <math.h>

log是e为底的对数
log10是10为底的对数
其他的用换底公式自己转换
[解决办法]
http://en.cppreference.com/w/c/numeric/math

读书人网 >C++

热点推荐