NumPhp::negative

Numerical negative, element-wise.

Description

SciPhp\NdArray NumPhp::negative( array|NdArray $m )

Parameters

$m
An array [1, 2, 3] or a NdArray.

Return Values

The new SciPhp\NdArray

Examples

use SciPhp\NumPhp as np;

$x np::arange(0102);

echo 
np::negative($x);

The above example will output:

[0   -2  -4  -6  -8]

See Also