diff --git a/CHANGELOG.md b/CHANGELOG.md index 18acc97..de00752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - IcdEnvironment.GetUtcTime() to get UTC representaiton of current time. - Extension methods for determining if a sequence is in order + - Overload for calculating the modulus of longs ## [9.9.0] - 2019-09-16 ### Added diff --git a/ICD.Common.Utils/MathUtils.cs b/ICD.Common.Utils/MathUtils.cs index e81584a..4143d68 100644 --- a/ICD.Common.Utils/MathUtils.cs +++ b/ICD.Common.Utils/MathUtils.cs @@ -216,11 +216,24 @@ namespace ICD.Common.Utils /// /// /// - /// method name can't be "Mod", due to S+ compatability issues + /// Method name can't be "Mod", due to S+ compatibility issues public static int Modulus(int number, int mod) { int remainder = number % mod; return remainder < 0 ? remainder + mod : remainder; } + + /// + /// Calculates the modulus of the given number. + /// + /// + /// + /// + /// Method name can't be "Mod", due to S+ compatibility issues + public static long Modulus(long number, long mod) + { + long remainder = number % mod; + return remainder < 0 ? remainder + mod : remainder; + } } }