__truediv__

array.__truediv__(other: int | float | complex | array, /) array

Evaluates self_i / other_i for each element of an array instance with the respective element of the array other.

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

  • other (Union[int, float, complex, array]) – other array. Must be compatible with self (see Broadcasting). Should have a numeric data type.

Returns:

out (array) – an array containing the element-wise results. The returned array should have a floating-point data type determined by Type Promotion Rules.

Notes

  • Element-wise results, including special cases, must equal the results returned by the equivalent element-wise function divide().

  • If one or both of self and other have integer data types, the result is implementation-dependent, as type promotion between data type “kinds” (e.g., integer versus floating-point) is unspecified.

    Specification-compliant libraries may choose to raise an error or return an array containing the element-wise results. If an array is returned, the array must have a real-valued floating-point data type.

Changed in version 2022.12: Added complex data type support.