Function clamp

  • Restrict an Ord to an inclusive interval.

    Type Parameters

    • T extends Ord<T>

    Parameters

    • val: T
    • lo: T
    • hi: T

    Returns T

    Remarks

    clamp(val, lo, hi) is equivalent to min(max(val, lo), hi).

Generated using TypeDoc