mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 01:06:01 +01:00
Adding ceil to NumberConversions
By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
parent
10e415be50
commit
3dc0047d2a
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