The Array API initially only allowed floating arrays and Python scalars for these functions, but has since allowed all numeric arrays/Python scalars. They currently do work for integer Python scalars, but are restricted from using integer arrays.
Power functions: xp.pow(), x.__pow()__ and x.__ipow()__
Divide functions: xp.divide(), x.__truediv__() and x.__itruediv__()
Note scalar scenarios can still fail as the left argument could be an integer array.
cc @asmeurer @IvanYashchuk
Reproduce the code example:
>>> import numpy.array_api as xp
>>> xp.asarray(2) / xp.asarray(2)
TypeError: Only floating-point dtypes are allowed in __truediv__
>>> xp.asarray(2) ** xp.asarray(2)
TypeError: Only floating-point dtypes are allowed in __pow__
NumPy/Python version information:
1.23.0.dev0+358.g1684a933d 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0]