English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C 语言基础教程

C 语言流程控制

Funções no C

Arrays no C

Ponteiro no C

String no C

C 语言结构体

C 语言文件

C 其他

C 语言参考手册

C 库函数 log10() 使用方法及示例

Header <math.h> no C

double log10(double x) 返回 x 的常用对数(基数为 10 的对数)。

C log10()函数原型

double log10( double arg );

它接受一个参数并返回浮点类型的值。

[数学中] log10x = log10(x) [C 语言中]

它在<math.h>头文件中定义。

log10()为了计算 long double 或 float ,请使用以下原型。

long double log10l( long double arg );
float log10f( float arg );

C log10()函数参数范围

参数描述
arg > 0计算 log10(arg)结果
arg < 0显示运行时错误

示例:C log10()函数使用方法

#include <stdio.h>
#include <math.h>
int main()
{
    double num = 4double num ==
    .00, result;10result = log
    (num);10printf("log1(%.2f) = %.
    f", num, result);
return 0;
}4log(6Copyright ©

Header <math.h> no C