Skip to content

Rename abstract numeric types like FloatingPoint and Complex? #8142

@jiahao

Description

@jiahao

We've seen empirical evidence that new users sometimes use abstract numeric types like FloatingPoint or Complex in lieu of concrete types like Float64 and Complex128. The result is that users end up with slow code or even wrong code due to operations over variables with types like Array{Complex,2} or Vector{FloatingPoint}. (For example: this comment in #4796)

The unintentional use of abstract numeric types seems especially prevalent with FloatingPoint or Complex which share common prefixes with concrete types. Other abstract numeric types like Signed or Real do not seem prone to accidental misuse to the same extent.

Suggestions for new names? I'd propose something like FloatingPointAbstract or AbstractFloatingPoint to emphasize the abstract nature of the type. And perhaps something like ComplexCartesian instead of Complex to emphasize the canonical (real, imaginary) representation and to distinguish it from polar forms or other more esoteric representations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codeneeds decisionA decision on this change is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions