Java Math expm1 ()

Metode Java Math expm1 () atgriež paaugstināto Eulera skaitli e līdz norādītās vērtības jaudai mīnus 1.

Tas ir ,. Arī matemātikā , .Math.expm1(4.0) = e4.0-1Math.expm1(x) = ex-1

Metodes sintakse expm1()ir šāda:

 Math.expm1(double a)

Piezīme . expm1()Metode ir statiska. Tādējādi mēs varam izsaukt metodi tieši, izmantojot klases nosaukumu Math.

expm1 () parametri

  • a - skaitlis, kas jāpaaugstina kā e spēks

expm1 () atgriešanās vērtības

  • atgriež e a-1 argumentam a

Piezīme . Šeit e ir Eulera numurs, kura vērtība ir 2,71828

Piemērs: 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() // value of Euler Number double euler = 2.71828d; System.out.println(Math.pow(euler, a)-1); // 53.5980031309658 ) )

Iepriekš minētajā piemērā esam izmantojuši metodi Math.pow (), lai aprēķinātu vērtību e 4.0 . Lūk, mēs to varam redzēt

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

Interesanti raksti...