Skip to content

int::abs should return an unsigned int #2353

Closed
@catamorphism

Description

@catamorphism

Currently, int::abs has a return type that's the same as its arg type, and writing int::abs(x) as uint looks very silly. I understand that it's not totally straightforward to write what we really want (basically, we want a type function that relates an int type of a given size to a uint type of a given size, and AFAICT we can't do that), but it would still be good. Maybe there's a clever workaround I'm not seeing...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions