mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Adding ceil to NumberConversions
This commit is contained in:
parent
55c12d5dd5
commit
1fd825cb7b
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue