English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Tutoriel de base Java

Contrôle de flux Java

Java Tableau

Java Programmation orientée objet (I)

Java Programmation orientée objet (II)

Java Programmation orientée objet (III)

Gestion des exceptions Java

Java Liste (List)

Java Queue (file d'attente)

Java Map collection

Java Set collection

Java Entrée/Sortie (I/O)

Java Reader/Writer

Autres sujets Java

Java Math expm1Méthode d'utilisation et exemple

Java Math mathematical methods

Java Math expm1La méthode () retourne la valeur spécifiée de e, le nombre d'Euler, soustraite de1puissance.

C'est-à-dire, aussi en mathématiques. Math.expm1(4.0) = e4.0-1Math.expm1(x) = ex-1

expm1La syntaxe de la méthode () est :

Math.expm1(double a)

NoteThe expm1() is a static method. Therefore, we can call this method directly using the class name Math.

expm1() parameter

  • a - as the number to be raised to the power of e

expm1() return value

  • returns the parameter a'se a-1

NoteHere, e is Euler's number, whose value is2.71828

Example: Java Math.expm1()

class Main {
  public static void main(String[] args) {
    // Math.expm1() method
    double a = 4.0d;
    System.out.println(Math.expm1(a));  // 53.598150033144236
    //without using 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.0Values. Here, we can see

Math.expm1(4.0) = e4.0-1

Java Math mathematical methods