array.__abs__() array

Calculates the absolute value for each element of an array instance (i.e., the element-wise result has the same magnitude as the respective element but has positive sign).


For signed integer data types, the absolute value of the minimum representable integer is implementation-dependent.

Special cases

For floating-point operands, let self equal x.

  • If x_i is NaN, the result is NaN.

  • If x_i is -0, the result is +0.

  • If x_i is -infinity, the result is +infinity.


self (array) – array instance. Should have a numeric data type.


out (array) – an array containing the element-wise absolute value. The returned array must have the same data type as self.


Element-wise results must equal the results returned by the equivalent element-wise function abs().