当前位置:首页 » 编程语言 » log10函数C语言

log10函数C语言

发布时间: 2023-08-11 17:48:18

① C语言中log函数怎么使用

先引用
#include <math.h>

假设要计算log3(9)的值,因为C语言的logx是以e为底的相当于lnx,如果以其他数作为对数的底,必须写成
float i
i=log(9)/log(3);

② C语言中log函数怎么使用呢

1、C语言中,有两个log函数,分别为log10和log函数,具体用法如下:
2、函数名: log10
功 能: 对数函数log,以10为底
用 法: double log10(double x);
程序示例:
#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;
}
3、函数名: log
功 能: 对数函数log,以e(2.71828)为底
用 法: double log(double x);
程序示例:
#include <math.h>
#include <stdio.h>int main(void)
{
double result;
double x = 800.6872;
result = log(x);
printf("The common log of %lf is %lf\n", x, result);
return 0;
}

热点内容
网页加密代码 发布:2025-09-18 21:56:12 浏览:163
安卓targz解压 发布:2025-09-18 21:45:58 浏览:800
怎么设置手机屏幕密码怎么设置 发布:2025-09-18 21:44:18 浏览:817
直线插补算法 发布:2025-09-18 21:22:49 浏览:654
矩阵内的算法 发布:2025-09-18 20:55:07 浏览:572
android网络优化 发布:2025-09-18 20:53:19 浏览:218
看交换机配置哪些是默认的 发布:2025-09-18 20:46:59 浏览:620
在钉钉上如何获取自己的密码 发布:2025-09-18 20:46:12 浏览:855
pythonifthenelse 发布:2025-09-18 20:33:19 浏览:916
热血传奇脚本怎么做 发布:2025-09-18 20:29:06 浏览:614