13
0
geforkt von Mirrors/Paper

Adding ceil to NumberConversions

By: Wesley Wolfe <weswolf@aol.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2012-04-15 18:25:57 -05:00
Ursprung 10e415be50
Commit 3dc0047d2a

Datei anzeigen

@ -11,6 +11,11 @@ public final class NumberConversions {
return floor == num ? floor : floor - (int) (Double.doubleToRawLongBits(num) >>> 63);
}
public static int ceil(final double num) {
final int floor = (int) num;
return floor == num ? floor : floor + (int) (~Double.doubleToRawLongBits(num) >>> 63);
}
public static int round(double num) {
return floor(num + 0.5d);
}