Calculate the exponential of all elements in the input array.
SciPhp\NdArray
NumPhp::exp(
array|NdArray
$m
)
$m
use SciPhp\NumPhp as np;
$m = np::exp([0, 1, M_E]);
echo "m\n$m";
The above example will output:
m [1 2.718281828459 15.154262241479]
use SciPhp\NumPhp as np;
$m = np::diag([0, 1, 2, 3]);
$r = np::exp($m);
echo "m\n$m", "r\n$r";
The above example will output:
m [[0 0 0 0] [0 1 0 0] [0 0 2 0] [0 0 0 3]] r [[1 1 1 1 ] [1 2.718281828459 1 1 ] [1 1 7.3890560989307 1 ] [1 1 1 20.085536923188]]