On Python 2 & 3: ```python 10 ** -9 == 10 ** int(-9) == pow(10, -9) == 10e-9 ``` However, with newint, any negative power still returns a newint, which becomes 0: ```python from future.builtins import int as newint pow(10, newint(-9)) == 0 ``` In such case, `__pow__()` should return a float.
Activity
pieleric commentedon Jul 1, 2020
BTW, I've looked quickly at the code in
future/types/newint.pyand it seems that something similar to__mul__()works:Fix pow() with negative newint (issue #568)
edschofield commentedon Feb 21, 2024
Thanks @pieleric . I've added your fix in
master.