当前位置: C语言 -- 标准库 -- <math.h> -- log10l

log10l函数


概要:
#include <math.h>
long double log10l(long double x);

描述:

该函数是以10为底数的对数函数,计算log10x的值。

如果参数x为负值,将发生域错误。

如果参数x等于0,将可能发生极点错误。


参数:
long double x

参数为一个long double类型的浮点数。


返回值:

函数返回log10x


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
/*函数log10l范例*/

#include <math.h>
#include <stdio.h>

int main(void)
{
    long double x = 100.0L;
    long double y;

    y = log10l(x);
    printf("The base-10 logarithm of %.6Lf is %.6Lf.\n", x, y);

    return 0;
}

输出:

The base-10 logarithm of 100.000000 is 2.000000.


相关内容:
log10 double类型的以10为底数的对数函数。
log10f float类型的以10为底数的对数函数。