log

#include<bits/stdc++.h>

using namespace std;

int main() {
    double a = 10;
    cout << log10(a) << endl;//lg

    cout << log(a) << endl;//ln
    double b = 100;
    cout << log(b)/log(a) << endl;//a为底
    return 0;
}

输出

1
2.30259
2
posted @ 2019-11-01 22:00  Hazelxcf  阅读(184)  评论(0编辑  收藏  举报