From 85f53faa9201e468c58d3bf124f4c4dfbc36c2b7 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sat, 5 Aug 2017 17:08:38 +1000 Subject: + Added Custom RTG. + Added RTG fuel use recipes for RTG Pellets. --- src/Java/gtPlusPlus/core/util/math/MathUtils.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index a46bd8c61d..b61af67566 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -197,6 +197,20 @@ public class MathUtils { } return result; } + + + //Smooth Rounding Function + /** + * Returns a long. + * The returned number is d rounded to the nearest flat long. + * Supports Doubles as input. + * + * @param current Current value. + * @return long Rounded value. + */ + public static long roundToClosestLong(final double d) { + return (long) (Math.round(d * 2) / 2.0); + } /** -- cgit