__pow__¶
- array.__pow__(other: int | float | complex | array, /) array¶
Calculates an implementation-dependent approximation of exponentiation by raising each element (the base) of an array instance to the power of
other_i(the exponent), whereother_iis the corresponding element of the arrayother.- Parameters:
self (array) – array instance whose elements correspond to the exponentiation base. Should have a numeric data type.
other (Union[int, float, complex, array]) – other array whose elements correspond to the exponentiation exponent. 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 must have a 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
pow().If both
selfandotherhave integer data types, the result of__pow__whenother_iis negative (i.e., less than zero) is unspecified and thus implementation-dependent.If
selfhas an integer data type andotherhas a floating-point data type, behavior is implementation-dependent, as type promotion between data type “kinds” (e.g., integer versus floating-point) is unspecified.
Changed in version 2022.12: Added complex data type support.