English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Java Math Mathematical Methods
Java Math expm1Die ()-Methode gibt den angegebenen Wert der Euler-Zahl e ab.1Die Potenz.
Das bedeutet, auch in der Mathematik. Math.expm1(4.0) = e4.0-1Math.expm1(x) = ex-1
expm1Die Syntax der ()-Methode lautet:
Math.expm1(double a)
Note: The expm1() is a static method. Therefore, we can use the class name Math to directly call this method.
a - to be used as the power of e
returns the parameter a'se a-1
NoteHere, e is Euler's number, whose value is2.71828
class Main { public static void main(String[] args) { // Math.expm1() method double a = 4.0d; System.out.println(Math.expm1(a)); // 53.598150033144236 //without Math.expm1() //the value of Euler's number double euler = 2.71828d; System.out.println(Math.pow(euler, a)-1); // 53.5980031309658 } }
In the above example, we usedMath.pow()methods to calculatee 4.0Value. Here, we can see
Math.expm1(4.0) = e4.0-1