Skip to content

Base.literal_pow undesired floating-point conversion for base of ±1? #53735

@oscardssmith

Description

@oscardssmith
julia> Base.literal_pow(^, -1, Val(-1))
-1.0

julia> y = -1
-1

julia> (-1)^y
-1

This has been broken since at least 1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    mathsMathematical functionsspeculativeWhether the change will be implemented is speculative

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions