From 39dfea762296a0ba1a6b7753cd3a21256a3f20b8 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 25 Aug 2023 02:42:51 +0100 Subject: [PATCH] [ci skip] fix: define CountDigits in the correct file I'm an idiot. --- X10D/src/Math/BinaryIntegerExtensions.cs | 16 ++++++++++++++++ X10D/src/Math/NumberExtensions.cs | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) 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. ///