User Tools

Site Tools


4rpl:commands:clamp01

Index
Math Utility

clamp01

clamp01(<-val)

Description

Clamps value between 0 and 1 and returns value. If the value is negative then zero is returned. If value is greater than one then one is returned. If the value is a vector, each element of the vector is clamped separately.

Examples

trace(clamp01(42)) #prints '1'

Index

4rpl/commands/clamp01.txt · Last modified: 2022/09/04 09:25 by Karsten75