Here you can find the source of clamp(double value, double low, double high)
public static double clamp(double value, double low, double high)
//package com.java2s; //License from project: Open Source License public class Main { public static double clamp(double value, double low, double high) { return Math.min(Math.max(value, low), high); }/*ww w.ja va2 s .co m*/ }