Java tutorial
//package com.java2s; public class Main { public static Float getFloat(float value, float minValue, float maxValue) { return Math.min(maxValue, Math.max(minValue, value)); } }