The non-negative square-root of an array, element-wise.
SciPhp\NdArray
NdArray::sqrt(
array|NdArray
$m
)
$m
The new SciPhp\NdArray
use SciPhp\NumPhp as np;
$m = np::vander([1, 4, 9]);
$n = np::sqrt($m);
echo "m=n\n$m", "n=m*m\n$n";
The above example will output:
m=n [[1 1 1 ] [16 4 1 ] [81 9 1 ]] n=sqrt(m) [[1 1 1] [4 2 1] [9 3 1]]