Calculate the exponential of all elements in the array.
SciPhp\NdArray
NdArray::exp()
This function has no parameters.
use SciPhp\NumPhp as np;
$m = np::ar([0, 1, M_E])->exp();
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 = $m->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]]