diff --git a/Engine.Core/Math.cs b/Engine.Core/Math.cs
index 2e20485..4fe4d52 100644
--- a/Engine.Core/Math.cs
+++ b/Engine.Core/Math.cs
@@ -249,13 +249,13 @@ public static class Math
public static float Round(float x, int digits, MidpointRounding mode) => MathF.Round(x, digits, mode);
///
- /// Rounds a number to a specified number of fractional digits.
+ /// Rounds a number to an integer.
///
/// The number to round.
- /// The number of fractional digits in the return value.
- /// Specification for how to round if it is midway between two other numbers.
- /// The number rounded to fractional digits.
- public static int RoundToInt(float x) => (int)MathF.Round(x, 0, MidpointRounding.ToEven);
+ /// Specification for how to round if it's midway between two numbers
+ ///
+ public static int RoundToInt(float x, RoundMode roundMode = RoundMode.Ceil) => (int)MathF.Round(x, 0, roundMode == RoundMode.Ceil ? MidpointRounding.ToPositiveInfinity : MidpointRounding.ToNegativeInfinity);
+ public enum RoundMode { Ceil, Floor };
///
/// Returns the square of a number.
diff --git a/Engine.Core/MathExtensions.cs b/Engine.Core/MathExtensions.cs
index 7b6725d..e98df7f 100644
--- a/Engine.Core/MathExtensions.cs
+++ b/Engine.Core/MathExtensions.cs
@@ -83,8 +83,8 @@ public static class MathExtensions
///
public static float Round(this float x, int digits, MidpointRounding mode) => Math.Round(x, digits, mode);
- ///
- public static int RoundToInt(this float x) => Math.RoundToInt(x);
+ ///
+ public static int RoundToInt(this float x, Math.RoundMode roundMode = Math.RoundMode.Ceil) => Math.RoundToInt(x, roundMode);
///
public static T Sqr(this T x) where T : INumber => Math.Sqr(x);