Skip to content

Commit 0663d42

Browse files
Increase the accuracy of the calculation
1 parent c2775c6 commit 0663d42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/de/redstoneworld/redutilities/math/Calculation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public static long getServerTicksFromMillis(long millis) {
1919
* round function of Math always rounds up or down to "1".
2020
*
2121
* @param input (double) value
22-
* @param x (float) rounding accuracy (e.g. "0.5")
23-
* @return (float) the rounded value
22+
* @param x (double) rounding accuracy (e.g. "0.5")
23+
* @return (double) the rounded value
2424
*/
25-
public static float roundToX(double input, float x) {
26-
return (Math.round(input / x)) * x;
25+
public static double roundToX(double input, double x) {
26+
return Math.round(input / x) * x;
2727
}
2828
}

0 commit comments

Comments
 (0)