dap4/d4core/src/main/java/dap4/core/util/CoreTypeFcns.java
static protected long
    minmax(long value, long min, long max)
    {
        if(value < min) return min;
        if(value > max) return max;
        return value;
    }
static protected long
    minmax(long value, long min, long max)
    {
        if(value < min) return min;
        if(value > max) return max;
        return value;
    }
Peg a value to either the min or max
depending on sign.

@param value the value to peg
@param min   peg to this if value is < min
@param max   peg to this if value is > max
@return pegg'ed value