C 库函数 - exp()

C 语言教程 · 2019-02-23 08:12:30

描述

C 库函数 double exp(double x) 返回 ex 次幂的值。

声明

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

double exp(double x)

参数

  • x -- 浮点值。

返回值

该函数返回 e 的 x 次幂。

实例

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

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

int main ()
{
   double x = 0;
  
   printf("e 的 %lf 次幂是 %lf\n", x, exp(x));
   printf("e 的 %lf 次幂是 %lf\n", x+1, exp(x+1));
   printf("e 的 %lf 次幂是 %lf\n", x+2, exp(x+2));
   
   return(0);
}

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

e 的 0.000000 次幂是 1.000000
e 的 1.000000 次幂是 2.718282
e 的 2.000000 次幂是 7.389056

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

查看所有标签

MongoDB

MongoDB

Kristina Chodorow、Michael Dirolf / O'Reilly Media / 2010-9-24 / USD 39.99

Discover how MongoDB can help you manage a huMONGOus amount of data collected through your web application. This book covers the basic principles and advanced uses of this document-oriented database, ......一起来看看 《MongoDB》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具