Skip to content

Exponentiation operator #2897

@wild-billy

Description

@wild-billy

So the math module has 2 different exponentiation functions, pow(x,y) and ``^(x,y). The operator version (`^`) can't handle negative `y`, which is an unexpected limitation.

Since both are ostensibly supposed to represent the same operation ("x raised to the power of y"), I'd suggest making ^ an alias for pow() (least surprise, right?), and optimizing pow() if needed/desired.

This hopefully wouldn't break any existing code (exponentiation is exponentiation, in theory), and frankly it's probably best to end the opportunity for any code to depend on the difference.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions