13 lines
342 B
Java
13 lines
342 B
Java
package org.solovyev.android.calculator.math;
|
|
|
|
public class MathUtils {
|
|
|
|
public static int clamp(int value, int min, int max) {
|
|
return value < min ? min : (value > max ? max : value);
|
|
}
|
|
|
|
public static float clamp(float value, float min, float max) {
|
|
return value < min ? min : (value > max ? max : value);
|
|
}
|
|
}
|