当前位置:首页 » 编程语言 » 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;
}

热点内容
安卓手机电影怎么投屏到ipad上 发布:2025-03-20 04:27:23 浏览:677
苹果安卓基于什么开发 发布:2025-03-20 04:20:52 浏览:520
算法化是 发布:2025-03-20 03:48:20 浏览:771
拆二代访问 发布:2025-03-20 03:47:34 浏览:63
随机数排序c语言 发布:2025-03-20 03:35:31 浏览:498
当前页面脚本发生错误类型不匹配 发布:2025-03-20 03:26:47 浏览:993
strutsajax上传图片 发布:2025-03-20 03:25:03 浏览:386
手机在线缓存 发布:2025-03-20 03:21:06 浏览:46
ftp路径上传时间 发布:2025-03-20 03:13:42 浏览:104
电脑连接通讯服务器失败怎么回事 发布:2025-03-20 03:10:30 浏览:287