NdArray::copysign

Change the sign to that of given matrix, element-wise.

Description

SciPhp\NdArray NdArray::copysign( array|NdArray $m )

Parameters

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

Return Values

A SciPhp\NdArray

Examples

Example #1: Copy sign of an array

use SciPhp\NumPhp as np;

$m np::ar([-555])->copysign([10, -1]);

echo 
"m\n$m";

The above example will output:

m
[5   5   -5]

See Also