Here you can find the source of clipDouble(double value, double max)
public static double clipDouble(double value, double max)
//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; } }