Here you can find the source of clamp(float min, float max, float value)
public static float clamp(float min, float max, float value)
//package com.java2s; //License from project: Open Source License public class Main { public static double clamp(double min, double max, double value) { if (min > value) return min; if (max < value) return max; return value; }// w ww . j av a 2 s . co m public static float clamp(float min, float max, float value) { if (min > value) return min; if (max < value) return max; return value; } }