negative

negative(x: array, /) array

Computes the numerical negative of each element x_i (i.e., y_i = -x_i) of the input array x.

Note

For signed integer data types, the numerical negative of the minimum representable integer is implementation-dependent.

Note

If x has a complex floating-point data type, both the real and imaginary components for each x_i must be negated (a result which follows from the rules of complex number multiplication).

Parameters:

x (array) – input array. Should have a numeric data type.

Returns:

out (array) – an array containing the evaluated result for each element in x. The returned array must have a data type determined by Type Promotion Rules.

Notes

Changed in version 2022.12: Added complex data type support.