
gnu.util.Math Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of escher Show documentation
Show all versions of escher Show documentation
Escher is a collection of libraries for X Window System written purely in Java.
The newest version!
package gnu.util;
/** Common math-related utility. */
public class Math {
public static double clamp (double i, double low, double high) {
return java.lang.Math.max (java.lang.Math.min (i, high), low);
}
public static float clamp (float i, float low, float high) {
return java.lang.Math.max (java.lang.Math.min (i, high), low);
}
public static int clamp (int i, int low, int high) {
return java.lang.Math.max (java.lang.Math.min (i, high), low);
}
public static long clamp (long i, long low, long high) {
return java.lang.Math.max (java.lang.Math.min (i, high), low);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy