step
The step function is the simplest of filters. When the given value reaches or exceeds the threshold, 1.0 is produced. Otherwise, 0.0.
- step(a, x)
- Returns 0 when (x < a), 1 otherwise.
COPY/// @func step(a, x)
///
/// @desc Returns 0 when (x < a), 1 otherwise.
///
/// @param {real} a threshold value
/// @param {real} x value
///
/// @return {real} 0 or 1
///
/// GMLscripts.com/license
function step(a, x)
{
if (x < a) return 0;
return 1;
}
Contributors: xot
GitHub: View · Commits · Blame · Raw