mirror of
http://git.eaglercraft.rip/eaglercraft/eaglercraft-1.8.git
synced 2025-04-30 02:01:59 -05:00
18 lines
275 B
Java
18 lines
275 B
Java
package net.optifine.util;
|
|
|
|
public class NumUtils {
|
|
public static float limit(float val, float min, float max) {
|
|
return val < min ? min : (val > max ? max : val);
|
|
}
|
|
|
|
public static int mod(int x, int y) {
|
|
int i = x % y;
|
|
|
|
if (i < 0) {
|
|
i += y;
|
|
}
|
|
|
|
return i;
|
|
}
|
|
}
|