C 库函数 - log10()

C 语言教程 · 2019-02-23 09:13:13

描述

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

声明

下面是 log10() 函数的声明。

double log10(double x)

参数

  • x -- 浮点值。

返回值

该函数返回 x 的常用对数,x 的值大于 0。

实例

下面的实例演示了 log10() 函数的用法。

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

int main ()
{
   double x, ret;
   x = 10000;
  
   /* 计算 log10(10000) */
   ret = log10(x);
   printf("log10(%lf) = %lf\n", x, ret);
   
   return(0);
}

让我们编译并运行上面的程序,这将产生以下结果:

log10(10000.000000) = 4.000000

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

Computational Geometry

Computational Geometry

Mark de Berg、Otfried Cheong、Marc van Kreveld、Mark Overmars / Springer / 2008-4-16 / USD 49.95

This well-accepted introduction to computational geometry is a textbook for high-level undergraduate and low-level graduate courses. The focus is on algorithms and hence the book is well suited for st......一起来看看 《Computational Geometry》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具