# Clamp (Real)
Grammar — Clamp value between min and max
Flags —Function
Adjust the value to make sure it stays within the provided bounds.
# Arguments
fixed
— Valuefixed
— Minfixed
— Max
Returns — fixed
fixed libNtve_gf_ArithmeticRealClamp(
fixed lp_value,
fixed lp_min,
fixed lp_max,
);
# Related
Category: Math / Arithmetic
- [F] —
int
— Absolute Value (Integer) — ( AbsI ) - [F] —
fixed
— Absolute Value (Real) — ( AbsF ) - [F] —
int
— Arithmetic (Integer) — ( ) - [F] —
int
— Bitwise Arithmetic (Integer) — ( ) - [F] —
fixed
— Arithmetic (Real) — ( ) - [F] —
int
— Arithmetic Multiple (Integer) — ( ) - [F] —
int
— Bitwise Arithmetic Multiple (Integer) — ( ) - [F] —
fixed
— Arithmetic Multiple (Real) — ( ) - [F] —
int
— Ceiling (Integer) — ( CeilingI ) - [F] —
fixed
— Ceiling (Real) — ( Ceiling ) - [F] —
int
— Clamp (Integer) — ( libNtve_gf_ArithmeticIntClamp ) - [F] —
fixed
— Clamp (Real) — ( libNtve_gf_ArithmeticRealClamp ) - [F] —
void
— Cycle — ( ) - [F] —
int
— Floor (Integer) — ( FloorI ) - [F] —
fixed
— Floor (Real) — ( Floor ) - [F] —
int
— Log2 (Integer) — ( Log2I ) - [F] —
fixed
— Log2 (Real) — ( Log2 ) - [F] —
fixed
— Log (Real) — ( libNtve_gf_Log ) - [F] —
int
— Modulo (Integer) — ( ModI ) - [F] —
fixed
— Modulo (Real) — ( ModF ) - [F] —
int
— Power (Integer) — ( PowI ) - [F] —
fixed
— Power (Real) — ( Pow ) - [F] —
int
— Round (Integer) — ( RoundI ) - [F] —
fixed
— Round (Real) — ( Round ) - [F] —
int
— Pow2 (Integer) — ( Pow2I ) - [F] —
fixed
— Pow2 (Real) — ( Pow2 ) - [F] —
int
— Square Root (Integer) — ( SquareRootI ) - [F] —
fixed
— Square Root (Real) — ( SquareRoot ) - [F] —
int
— Trunc (Integer) — ( TruncI ) - [F] —
fixed
— Trunc (Real) — ( Trunc )
# Examples
# mods/heroesmapmods/battlegroundmapmods/volskayamechanics.stormmod
// L311
libNtve_gf_ArithmeticRealClamp(lv_newProgress, 0.0, libVLSK_gv_capturePointContestTimeGoal_C)
// L390
libNtve_gf_ArithmeticRealClamp(lv_newProgressValue, 0.0, libVLSK_gv_capturePointContestTimeGoal_C)
// L438
libNtve_gf_ArithmeticRealClamp(libVLSK_gv_capturePoints[lp_capturePointIndex].lv_victoryTimes[lv_team], 0.0, (libVLSK_gv_capturePointVictoryTimeGoal_C * 0.999))
# mods/heromods/hanzo.stormmod
// L230
libNtve_gf_ArithmeticRealClamp(lv_currentSearchStartDistance, lv_searchStartDistance, lv_searchEndDistance)
// L231
libNtve_gf_ArithmeticRealClamp(lv_currentSearchEndDistance, lv_searchStartDistance, lv_searchEndDistance)