feat(math): Math.OneOver and Invert methods added

This commit is contained in:
2026-04-04 18:50:47 +03:00
parent af2eed2200
commit 7fb6821a83
2 changed files with 16 additions and 0 deletions

View File

@@ -30,6 +30,16 @@ public static class Math
/// </summary>
public const float DegreeToRadian = Pi / 180f;
/// <inheritdoc cref="Invert{T}(T)" />
public static T OneOver<T>(T value) where T : INumber<T> => T.One / value;
/// <summary>
/// Gets 1 / value of given <see cref="T"/>.
/// </summary>
/// <param name="value">The value <see cref="T"/>.</param>
/// <returns>1 / value of given <see cref="T"/>.</returns>
public static T Invert<T>(T value) where T : INumber<T> => T.One / value;
/// <summary>
/// Gets one minus of given <see cref="T"/>.
/// </summary>