real

real(x: array, /) array

Returns the real component of a complex number for each element x_i of the input array x.

Parameters:

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

Returns:

out (array) – an array containing the element-wise results. The returned array must have a floating-point data type with the same floating-point precision as x (e.g., if x is complex64, the returned array must have the floating-point data type float32).

Notes

  • Whether the returned array and the input array share the same underlying memory is unspecified and thus implementation-defined.

New in version 2022.12.