Skip to content

proposal: allow conversion of bools to numerics. #45341

Closed
@docmerlin

Description

@docmerlin

A lot of branch-less algorithms are developed for c where a<b is 0 when false and 1 when true.

It would be really helpful to be able to use those algorithms by being able to have uint64(a<b) and it be uint64(0) or uint64(1) depending on a and b.

Note: this isn't an April fools proposal. (someone pointed out I should say this).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions