[ci skip] fix: define CountDigits in the correct file

I'm an idiot.
This commit is contained in:
Oliver Booth 2023-08-25 02:42:51 +01:00
parent 423fb90cc4
commit 39dfea7622
Signed by: oliverbooth
GPG Key ID: B89D139977693FED
2 changed files with 16 additions and 16 deletions

View File

@ -11,6 +11,22 @@ namespace X10D.Math;
/// </summary>
public static class BinaryIntegerExtensions
{
/// <summary>
/// Returns the number of digits in the current binary integer.
/// </summary>
/// <param name="value">The value whose digit count to compute.</param>
/// <returns>The number of digits in <paramref name="value" />.</returns>
public static int CountDigits<TNumber>(this TNumber value)
where TNumber : IBinaryInteger<TNumber>
{
if (TNumber.IsZero(value))
{
return 1;
}
return 1 + (int)System.Math.Floor(System.Math.Log10(System.Math.Abs(double.CreateChecked(value))));
}
/// <summary>
/// Computes the digital root of this integer.
/// </summary>

View File

@ -11,22 +11,6 @@ namespace X10D.Math;
/// </summary>
public static class NumberExtensions
{
/// <summary>
/// Returns the number of digits in the current binary integer.
/// </summary>
/// <param name="value">The value whose digit count to compute.</param>
/// <returns>The number of digits in <paramref name="value" />.</returns>
public static int CountDigits<TNumber>(this TNumber value)
where TNumber : IBinaryInteger<TNumber>
{
if (TNumber.IsZero(value))
{
return 1;
}
return 1 + (int)System.Math.Floor(System.Math.Log10(System.Math.Abs(double.CreateChecked(value))));
}
/// <summary>
/// Returns a value indicating whether the current value is evenly divisible by 2.
/// </summary>