Skip to content

pow() with negative newint returns always 0 #568

@pieleric

Description

@pieleric

On Python 2 & 3:

10 ** -9 == 10 ** int(-9) == pow(10, -9) == 10e-9

However, with newint, any negative power still returns a newint, which becomes 0:

from future.builtins import int as newint
pow(10, newint(-9)) == 0

In such case, __pow__() should return a float.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions