Skip to content

proposal: math: add Clamp function #58146

@gucio321

Description

@gucio321

somethimes, I need to get a number clamped in a range. I think math package would be appropiate to add such a Clamp function.

Also, for some percentage calculation, Clamp01 method is useful as well.

(see #58144)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions