Skip to content

Commit ffa62ae

Browse files
Added Frequency unit and unit tests
1 parent 6fc8191 commit ffa62ae

13 files changed

+1177
-3
lines changed

OnixLabs.Numerics/GenericMath.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static class GenericMath
4040
/// <returns>Returns the factorial of the specified <see cref="IBinaryInteger{TSelf}"/> value.</returns>
4141
public static BigInteger Factorial<T>(T value) where T : IBinaryInteger<T>
4242
{
43-
Require(value >= T.Zero, "Value must be greater than or equal to zero.");
43+
Require(value >= T.Zero, "Value must be greater than or equal to zero.", nameof(value));
4444

4545
if (value <= T.One) return BigInteger.One;
4646

@@ -84,15 +84,15 @@ public static T Pow10<T>(int exponent) where T : INumber<T>
8484
{
8585
Require(exponent >= 0, "Exponent must be greater than, or equal to zero.", nameof(exponent));
8686

87-
if (exponent == 0)
87+
if (exponent is 0)
8888
return T.One;
8989

9090
T result = T.One;
9191
T baseValue = T.CreateChecked(10);
9292

9393
while (exponent > 0)
9494
{
95-
if ((exponent & 1) == 1)
95+
if ((exponent & 1) is 1)
9696
result *= baseValue;
9797

9898
baseValue *= baseValue;

0 commit comments

Comments
 (0)