Java Double Number Clip clipDouble(double value, double max)

Here you can find the source of clipDouble(double value, double max)

Description

clip Double

License

LGPL

Declaration

public static double clipDouble(double value, double max) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static double clipDouble(double value, double max) {
        return clipDouble(value, 0, max);
    }//from w w w .  jav a2  s .c  o  m

    public static double clipDouble(double value, double min, double max) {
        return value > max ? max : value < min ? min : value;
    }
}

Related

  1. clip(double[] values, double min, double max)
  2. clip(final double n, final double minValue, final double maxValue)
  3. clip(final double value, final double min, final double max)
  4. clip2(double n, double d, double[] t)
  5. clipDecimals(double num, int n)
  6. clipnorm(double d, double min, double max)
  7. clipNormalized(double a)
  8. clipRange(double[] x, double minVal, double maxVal)
  9. clipRecklessly(double val, double bounds)