当前位置:首页 » 编程语言 » 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-03-19 18:39:31 浏览:503
php添加键值对 发布:2025-03-19 18:28:25 浏览:851
i5的什么配置最强 发布:2025-03-19 18:13:56 浏览:278
手动车怎么增加配置 发布:2025-03-19 17:59:47 浏览:591
androidjni进程 发布:2025-03-19 17:45:37 浏览:80
录像加密 发布:2025-03-19 17:43:24 浏览:50
编程题怎么做 发布:2025-03-19 17:42:40 浏览:169
数据库实战 发布:2025-03-19 16:58:14 浏览:306
ubuntu清空缓存 发布:2025-03-19 16:38:50 浏览:707
sql2005判断 发布:2025-03-19 16:29:48 浏览:724