diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-05-12 16:04:15 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-05-12 16:04:15 +1000 |
commit | d30f18947a5c5e275ef7f17323ac837939cb0135 (patch) | |
tree | a46120eaace0b136e056e55d53add6129d8e877b /src/Java/gtPlusPlus/core/util/math | |
parent | 3615baf8ffb7a2efc44d4770da97ce1337f7801e (diff) | |
download | GT5-Unofficial-d30f18947a5c5e275ef7f17323ac837939cb0135.tar.gz GT5-Unofficial-d30f18947a5c5e275ef7f17323ac837939cb0135.tar.bz2 GT5-Unofficial-d30f18947a5c5e275ef7f17323ac837939cb0135.zip |
% More work on Advanced Mufflers.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/math')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/math/MathUtils.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index 3cef3c511f..bda722b47e 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -7,6 +7,7 @@ import gregtech.api.enums.GT_Values; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; @@ -227,7 +228,7 @@ public class MathUtils { * @param x Value A. * @return boolean Whether or not it divides evenly. */ - public static boolean isNumberEven(final int x){ + public static boolean isNumberEven(final long x){ if ((x % 2) == 0) { return true; @@ -696,5 +697,11 @@ public class MathUtils { int aAmount = Math.max(Math.min(i, aMax), aMin); return aAmount; } + + public static Pair<Integer, Integer> splitLongIntoIntegers(long aLong){ + int aIntMaxInLong = (int) Math.min(Integer.MAX_VALUE, Math.floor(aLong/Integer.MAX_VALUE)); + int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE)); + return new Pair<Integer, Integer>(aIntMaxInLong, aRemainder); + } } |