__truediv__

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

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

Note

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.

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

  • other (Union[int, float, 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

Note

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

Changed in version 2022.12: Added complex data type support.