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

Manual Básico de Java

Controle de fluxo do Java

Java Array

Java Orientação a Objetos (I)

Java Orientação a Objetos (II)

Java Orientação a Objetos (III)

Tratamento de Exceções Java

Java Lista (List)

Java Queue (fila)

conjunto Map do Java

conjunto Set do Java

Java Entrada e Saída (I/O)

Reader do Java/Writer

Outros tópicos do Java

Java Math expm1Método de uso e exemplo ()

Java Math Mathematical Methods

Java Math expm1O método () retorna o valor específico da função e, subtraído1potência.

Isso é, também, na matemática. Math.expm1(4.0) = e4.0-1Math.expm1(x) = ex-1

expm1A sintaxe do método () é:

Math.expm1(double a)

Note: The expm1() is a static method. Therefore, we can use the class name Math to call this method directly.

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.0Value. Here, we can see

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

Java Math Mathematical Methods