NAME

clamp - clamp a value between two scalar limits

SYNOPSIS

val.clamp(lo,hi)

DESCRIPTION

The clamp method compares the val to the scalars lo and hi and returns a value clamped between lo and hi, inclusive.

RETURN VALUE

The clamped value

ERRORS

RangeCheck if lo is not less than or equal to hi
TypeCheck if val, lo, or hi are not numeric
TypeCheck if lo or hi are not scalar

EXAMPLE

    a = 10->iterate()
    a.clamp(2,7)
2 2 2 3 4 5 6 7 7 7