Skip to content

Make a^b return Float64 when b is signed integer #45321

@PallHaraldsson

Description

@PallHaraldsson

This seems sensible, and consistent with division (which is implied when b is negative). There needs to be an exception when a or b is a BigInt (or then return BigFloat, while BigInt result needs to also be an option). I'm not sure this would break a lot of code, but a way to get old behavior is I guess needed (and already existing).

If this is too breaking just add the 2.0 milestone...

Plan B would be overflow check (I'm not sure there's a separate open issue on it). It's a less good option IMHO, while it wouldn't be breaking, and would also apply for unsigned.

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