Skip to content

Add max and min math functions #7856

@IlanCosman

Description

@IlanCosman

It's not super common, but I've found myself wanting these functions to set upper and lower bounds on things.

Obviously this is just a nice tool to have, but as a specific use case, some string commands like pad and repeat will error if you give them negative numbers. Obviously we can't use abs here, so I've been doing test $blah -lt 0 && set $blah 0. This works of course, but it is less elegant and requires setting the value to a variable first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions