Here you can find the source of clamp(final float x, final float a, final float b)
public static final float clamp(final float x, final float a, final float b)
//package com.java2s; public class Main { public static final float clamp(final float x, final float a, final float b) { return x < a ? a : x > b ? b : x; }/*from w w w . j av a 2 s . com*/ }