fix: math round methods not working properly

This commit is contained in:
2025-10-16 15:37:03 +03:00
parent 6f1f30bd53
commit b75f30f864
2 changed files with 21 additions and 9 deletions

View File

@@ -81,7 +81,7 @@ public static class MathExtensions
public static T Lerp<T>(this T x, T y, T t) where T : IFloatingPoint<T> => Math.Lerp(x, y, t);
/// <inheritdoc cref="Math.Round(float, int, MidpointRounding)" />
public static float Round(this float x, int digits, MidpointRounding mode) => Math.Round(x, digits, mode);
public static float Round(this float x, Math.RoundMode mode) => Math.Round(x, mode);
/// <inheritdoc cref="Math.RoundToInt(float, Math.RoundMode)" />
public static int RoundToInt(this float x, Math.RoundMode roundMode = Math.RoundMode.Ceil) => Math.RoundToInt(x, roundMode);