diff --git a/X10D/src/Math/BinaryIntegerExtensions.cs b/X10D/src/Math/BinaryIntegerExtensions.cs index 20eae95..9029e6f 100644 --- a/X10D/src/Math/BinaryIntegerExtensions.cs +++ b/X10D/src/Math/BinaryIntegerExtensions.cs @@ -11,6 +11,22 @@ namespace X10D.Math; /// public static class BinaryIntegerExtensions { + /// + /// Returns the number of digits in the current binary integer. + /// + /// The value whose digit count to compute. + /// The number of digits in . + public static int CountDigits(this TNumber value) + where TNumber : IBinaryInteger + { + if (TNumber.IsZero(value)) + { + return 1; + } + + return 1 + (int)System.Math.Floor(System.Math.Log10(System.Math.Abs(double.CreateChecked(value)))); + } + /// /// Computes the digital root of this integer. /// diff --git a/X10D/src/Math/NumberExtensions.cs b/X10D/src/Math/NumberExtensions.cs index b2c68a1..12f00f8 100644 --- a/X10D/src/Math/NumberExtensions.cs +++ b/X10D/src/Math/NumberExtensions.cs @@ -11,22 +11,6 @@ namespace X10D.Math; /// public static class NumberExtensions { - /// - /// Returns the number of digits in the current binary integer. - /// - /// The value whose digit count to compute. - /// The number of digits in . - public static int CountDigits(this TNumber value) - where TNumber : IBinaryInteger - { - if (TNumber.IsZero(value)) - { - return 1; - } - - return 1 + (int)System.Math.Floor(System.Math.Log10(System.Math.Abs(double.CreateChecked(value)))); - } - /// /// Returns a value indicating whether the current value is evenly divisible by 2. ///