feat(math): Math.OneOver and Invert methods added
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user