exp(x): Exponential

Exponential function.

Declaración

Sintaxis

retval = exp(x)
elemental real function exp(x)

Argumentos

x the input value must be of type real or complex.

Valores devueltos

The return value is of same type as of the input argument, x.

Descripción

exp(x) computes the base \(e\) exponential of x, i.e., \(e^x\).

If x is of type complex, its imaginary part is considered as a value in radians.

Tipos

Supported argument types is real and complex.

interface exp
    module procedure sexp, dexp, cexp, zexp
end interface

contains

elemental real(sp) function sexp(x)
real(sp), intent(in) :: x
end function

elemental real(dp) function dexp(x)
real(dp), intent(in) :: x
end function

elemental complex(sp) function cexp(x)
complex(sp), intent(in) :: x
end function

elemental complex(dp) function zexp(x)
complex(dp), intent(in) :: x
end function

Ejemplos

program intrinsics_exp
	print *, exp(0.5)
end program

Result:

1.64872

Ver también