Here you can find the source of clip(float value, float bottom, float top)
public static float clip(float value, float bottom, float top)
//package com.java2s; public class Main { public static float clip(float value, float bottom, float top) { return (value < bottom) ? bottom : (value > top) ? top : value; }/* w w w .ja v a2 s . c o m*/ public static int clip(int value, int bottom, int top) { return (value < bottom) ? bottom : (value > top) ? top : value; } }