返回min-max之间的double
431523
public static double nextDouble(Random random, final double min, final double max) {
		Validate.isTrue(max >= min, "Start value must be smaller or equal to end value.");
		MoreValidate.nonNegative("min", min);

		if (Double.compare(min, max) == 0) {
			return min;
		}

		return min + ((max - min) * random.nextDouble());
	}
595024
public int getInt(final int min, final int max) {
		return min(min, max) + getInt(abs(max - min));
	}
163410
public double[] getMinMax(double[] array) {
		double[] minmax = new double[2];

		double max = Double.MIN_VALUE;
		double min = Double.MAX_VALUE;

		for(double value : array) {
			if(value > max) max = value;
			if(value < min) min = value;
		}

		minmax[0] = min;
		minmax[1] = max;
		return minmax;
	}
114951
public static double min(double... nums) {
    double min = nums[0];
    for (int i = 1; i < nums.length; i++) {
      if (nums[i] > min) {
        min = nums[i];
      }
    }
    return min;
  }
828117
function getMinimum() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        return Math.min.apply(Math, args);
    }
1185624
public void ensureMinMax() {
		double t;
		if (this.maxx < this.minx) {
			t = this.minx;
			this.minx = this.maxx;
			this.maxx = t;
		}
		if (this.maxy < this.miny) {
			t = this.miny;
			this.miny = this.maxy;
			this.maxy = t;
		}
		if (this.maxz < this.minz) {
			t = this.minz;
			this.minz = this.maxz;
			this.maxz = t;
		}
		if (this.maxm < this.minm) {
			t = this.minm;
			this.minm = this.maxm;
			this.maxm = t;
		}
	}
78061
public static float max(final float a, final float b) {
        if (a > b) {
            return a;
        }
        if (a < b) {
            return b;
        }
        /* if either arg is NaN, return NaN */
        if (a != b) {
            return Float.NaN;
        }
        /* min(+0.0,-0.0) == -0.0 */
        /* 0x80000000 == Float.floatToRawIntBits(-0.0d) */
        int bits = Float.floatToRawIntBits(a);
        if (bits == 0x80000000) {
            return b;
        }
        return a;
    }
474502
private float limit(float value, float min, float max) {
    return Math.min(Math.max(min, value), max);
  }
1370616
public static DoubleUnaryOperator clamp(
        final DoubleUnaryOperator function,
        final double min, final double max)
    {
        return x -> Math.max(min, Math.min(max, function.applyAsDouble(x)));
    }
966812
private double[] findMinMax(double[] lows, double[] highs) {

    double min = Double.MAX_VALUE;
    double max = -Double.MAX_VALUE;

    for (int i = 0; i < highs.length; i++) {

      if (!Double.isNaN(highs[i]) && highs[i] > max) {
        max = highs[i];
      }
      if (!Double.isNaN(lows[i]) && lows[i] < min) {
        min = lows[i];
      }
    }

    return new double[] {min, max};
  }
647487
public static int max(IntTuple t)
    {
        return IntTupleFunctions.reduce(
            t, Integer.MIN_VALUE, Math::max);
    }
1027165
private static int min(int a, int b, int c) {
        int r = a;
        if (r > b) r = b;
        if (r > c) r = c;
        return r;
    }
30707
function(w) {
    if(w.length === 0) { return {}; } // ... ;s
    var maxv = w[0];
    var minv = w[0];
    var maxi = 0;
    var mini = 0;
    var n = w.length;
    for(var i=1;i<n;i++) {
      if(w[i] > maxv) { maxv = w[i]; maxi = i; } 
      if(w[i] < minv) { minv = w[i]; mini = i; } 
    }
    return {maxi: maxi, maxv: maxv, mini: mini, minv: minv, dv:maxv-minv};
  }
1016356
def min_max(obj, val, is_max):
    
    n = getattr(obj, 'maximum' if is_max else 'minimum', None)
    if n == None:
        return

    _eq = getattr(obj, 'exclusiveMaximum' if is_max else 'exclusiveMinimum', False)
    if is_max:
        to_raise = val >= n if _eq else val > n
    else:
        to_raise = val <= n if _eq else val < n

    if to_raise:
        raise ValidationError('condition failed: {0}, v:{1} compared to o:{2}'.format('maximum' if is_max else 'minimum', val, n))
233528
private int getMax(double data[]) {
        int idx = 0;
        double max = data[0];
        for (int i = 1; i < data.length; i++) {
            if (max < data[i]) {
                max = data[i];
                idx = i;
            }
        }
        return idx;
    }
211586
static double min(double[] values) {
        double min = values[0];
        for (double value : values)
            if (value < min) min = value;
        return min;
    }
1335530
private DoubleMinMax exactMinMax(Relation<O> relation, DistanceQuery<O> distFunc) {
    final FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Exact fitting distance computations", relation.size(), LOG) : null;
    DoubleMinMax minmax = new DoubleMinMax();
    // find exact minimum and maximum first.
    for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
      for(DBIDIter iditer2 = relation.iterDBIDs(); iditer2.valid(); iditer2.advance()) {
        // skip the point itself.
        if(DBIDUtil.equal(iditer, iditer2)) {
          continue;
        }
        double d = distFunc.distance(iditer, iditer2);
        minmax.put(d);
      }
      LOG.incrementProcessed(progress);
    }
    LOG.ensureCompleted(progress);
    return minmax;
  }