__pow__¶
- array.__pow__(other: int | float | 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_i
is the corresponding element of the arrayother
.Note
If both
self
andother
have integer data types, the result of__pow__
whenother_i
is negative (i.e., less than zero) is unspecified and thus implementation-dependent.If
self
has an integer data type andother
has a floating-point data type, behavior is implementation-dependent, as type promotion between data type “kinds” (e.g., integer versus floating-point) is unspecified.- Parameters:
self (array) – array instance whose elements correspond to the exponentiation base. Should have a numeric data type.
other (Union[int, float, 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
Note
Element-wise results, including special cases, must equal the results returned by the equivalent element-wise function
pow()
.Changed in version 2022.12: Added complex data type support.