feat: added RoundToInt RoundMode for midway values

This commit is contained in:
2025-05-03 23:30:02 +03:00
parent fd11a94ddf
commit 063ea08707
2 changed files with 7 additions and 7 deletions

View File

@@ -83,8 +83,8 @@ public static class MathExtensions
/// <inheritdoc cref="Math.Round(float, int, MidpointRounding)" />
public static float Round(this float x, int digits, MidpointRounding mode) => Math.Round(x, digits, mode);
/// <inheritdoc cref="Math.RoundToInt(float)" />
public static int RoundToInt(this float x) => Math.RoundToInt(x);
/// <inheritdoc cref="Math.RoundToInt(float, Math.RoundMode)" />
public static int RoundToInt(this float x, Math.RoundMode roundMode = Math.RoundMode.Ceil) => Math.RoundToInt(x, roundMode);
/// <inheritdoc cref="Math.Sqr{T}(T)" />
public static T Sqr<T>(this T x) where T : INumber<T> => Math.Sqr(x);