Lua
C++
Edit

Clamp

This function constrains a value between a lower and upper limit.

Syntax

Parameter Description
value value to constrain
minimum lower limit of the return value
maximum upper limit of the return value

Returns

The closest value to the input value that is between the specified minimum and maximum will be returned.

Example

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    Print(Clamp(307, 0, 255));
    return 0;
}
Copyright © 2024 Ultra Software.
All rights reserved.