Here you can find the source of clip(float f, float lo, float hi)
public static float clip(float f, float lo, float hi)
//package com.java2s; //License from project: Open Source License public class Main { public static float clip(float f, float lo, float hi) { if (f < lo) return lo; if (f > hi) return hi; return f; }/*from w w w . j av a 2 s. c om*/ }