Java如何计算指数函数?
在数学中,指数函数是函数ex,其中e是使得函数ex等于自己的导数的数字(大约2.718281828)。该函数f(x)=ex在点x=0处等于1。
package org.nhooo.example.math;
public class ExponentExample {
public static void main(String[] args) {
double x = 0.0d;
// 计算e升到x(e ^ x)的幂
double fx = Math.exp(x);
// 计算e提高到x减1的幂(e ^ x-1)
double fxm1 = Math.expm1(x);
System.out.println("fx = " + fx);
System.out.println("fxm1 = " + fxm1);
}
}
热门推荐
1 如何训练狗狗不叫
2 训练狗狗不叫
3 训练狗狗随行
4 怎么训练狗狗不叫
7 训练比熊狗狗教程
10 上海狗狗训练
11 怎么训练狗狗上厕所
12 训练狗狗趴下
13 狗狗服从训练
14 训练狗狗拒食
15 训练狗狗笑
16 训练狗狗大便
17 训练狗狗立
18 训练狗狗捡东西