Java exp() 方法

Java 教程 · 2019-02-08 13:14:25

exp() 方法用于返回自然数底数e的参数次方。

语法

该方法有以下几种语法格式:

double exp(double d)

参数

  • d -- 任何原生数据类型。

返回值

返回自然数底数e的参数次方。

实例

public class Test{ 
    public static void main(String args[]){
        double x = 11.635;
        double y = 2.76;

        System.out.printf("e 的值为 %.4f%n", Math.E);
        System.out.printf("exp(%.3f) 为 %.3f%n", x, Math.exp(x));  
    }
}

编译以上程序,输出结果为:

e 的值为 2.7183
exp(11.635) 为 112983.831

点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html

查看所有标签

The Black Box Society

The Black Box Society

Frank Pasquale / Harvard University Press / 2015-1-5 / USD 35.00

Every day, corporations are connecting the dots about our personal behavior—silently scrutinizing clues left behind by our work habits and Internet use. The data compiled and portraits created are inc......一起来看看 《The Black Box Society》 这本书的介绍吧!

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

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具