src/main/java/frc/team5431/titan/core/misc/Calc.java
public final static double clamp(final double val, final double min, final double max)
			throws IllegalArgumentException {
		if (min > max)
			throw new IllegalArgumentException("Clamp max must be greater than min");
		return Math.max(min, Math.min(max, val));
	}
/**
	 * Clamps a number between two values.
	 * 
	 * @param val the value to clamp
	 * @param min the minimum allowed value
	 * @param max the maximum allowed value
	 * @return the clamped value
	 * @throws IllegalArgumentException if max is less than min
	 */
Clamps a number between two values.


Clamps a number between two values .
public final static double clamp(final double val, final double min, final double max)
			throws IllegalArgumentException {
		if (min > max)
			throw new IllegalArgumentException("Clamp max must be greater than min");
		return Math.max(min, Math.min(max, val));
	}
public final static double clamp ( final double val , final double min , final double max ) throws IllegalArgumentException { if ( min > max ) throw new IllegalArgumentException ( "Clamp max must be greater than min" ) ; return Math . max ( min , Math . min ( max , val ) ) ; }
Clamps a number between two values.
Clamps a number between two values .