fix: Rename "Mod" to "Modulus" to keep S+ from throwing a fit

This commit is contained in:
Drew Tingen
2019-09-09 15:06:39 -04:00
parent 9a6f197aa0
commit 0f618198b5
3 changed files with 6 additions and 6 deletions

View File

@@ -9,7 +9,7 @@
/// <returns></returns>
public static int To12Hour(int hour)
{
return MathUtils.Mod(hour + 11, 12) + 1;
return MathUtils.Modulus(hour + 11, 12) + 1;
}
}
}

View File

@@ -34,7 +34,7 @@ namespace ICD.Common.Utils.Extensions
/// <returns></returns>
public static TimeSpan AddHoursAndWrap(this TimeSpan extends, int hours)
{
hours = MathUtils.Mod(hours + extends.Hours, 24);
hours = MathUtils.Modulus(hours + extends.Hours, 24);
return new TimeSpan(extends.Days, hours, extends.Minutes, extends.Seconds, extends.Milliseconds);
}
@@ -49,8 +49,8 @@ namespace ICD.Common.Utils.Extensions
int currentHour = extends.Hours;
bool am = extends.Hours < 12;
int current12Hour = MathUtils.Mod(currentHour, 12);
int new12Hour = MathUtils.Mod(current12Hour + hours, 12);
int current12Hour = MathUtils.Modulus(currentHour, 12);
int new12Hour = MathUtils.Modulus(current12Hour + hours, 12);
return am
? new TimeSpan(extends.Days, new12Hour, extends.Minutes, extends.Seconds, extends.Milliseconds)
@@ -65,7 +65,7 @@ namespace ICD.Common.Utils.Extensions
/// <returns></returns>
public static TimeSpan AddMinutesAndWrap(this TimeSpan extends, int minutes)
{
minutes = MathUtils.Mod(minutes + extends.Minutes, 60);
minutes = MathUtils.Modulus(minutes + extends.Minutes, 60);
return new TimeSpan(extends.Days, extends.Hours, minutes, extends.Seconds, extends.Milliseconds);
}
}

View File

@@ -216,7 +216,7 @@ namespace ICD.Common.Utils
/// <param name="number"></param>
/// <param name="mod"></param>
/// <returns></returns>
public static int Mod(int number, int mod)
public static int Modulus(int number, int mod)
{
int remainder = number % mod;
return remainder < 0 ? remainder + mod : remainder;