From 621c69280832ad97c8833f881e73c34055b48bb3 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 14 Sep 2025 01:45:27 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #59 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Numbers/issues/59 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..af75631 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Numbers/issues/59 +Your prepared branch: issue-59-4b426f16 +Your prepared working directory: /tmp/gh-issue-solver-1757803524080 + +Proceed. \ No newline at end of file From f9679b0a3a6a45065542213b78f2d6f8fd630ea3 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 14 Sep 2025 01:50:51 +0300 Subject: [PATCH 2/3] Remove unused Factorial method and related code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Factorial method is no longer used in the LinksPlatform ecosystem as the Catalan method now uses precalculated values instead of depending on factorial calculations. This change: - Removes the unused Factorial method from Math.cs - Removes the _factorials array and MaximumFactorialNumber constant - Removes the CurrentFactorialImplementation benchmark test - Maintains all existing functionality for Catalan and IsPowerOfTwo methods Fixes #59 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../MathBenchmarks.cs | 6 ---- csharp/Platform.Numbers/Math.cs | 36 ------------------- 2 files changed, 42 deletions(-) diff --git a/csharp/Platform.Numbers.Benchmarks/MathBenchmarks.cs b/csharp/Platform.Numbers.Benchmarks/MathBenchmarks.cs index 77a4dbd..3738c55 100644 --- a/csharp/Platform.Numbers.Benchmarks/MathBenchmarks.cs +++ b/csharp/Platform.Numbers.Benchmarks/MathBenchmarks.cs @@ -194,12 +194,6 @@ public static ulong FactorialWhileLoopWithoutArrayAndCountingArrayLength(ulong n } private const ulong FactorialNumber = 19; - [Benchmark] - public ulong CurrentFactorialImplementation() - { - return Math.Factorial(FactorialNumber); - } - [Benchmark] public ulong FactorialUsingStaticArrayAndRecursionWithContantAsMaximumN() { diff --git a/csharp/Platform.Numbers/Math.cs b/csharp/Platform.Numbers/Math.cs index 84a48b7..41987c1 100644 --- a/csharp/Platform.Numbers/Math.cs +++ b/csharp/Platform.Numbers/Math.cs @@ -11,12 +11,6 @@ namespace Platform.Numbers /// Resizable array (FileMappedMemory) for values cache may be used. or cached oeis.org public static class Math { - private static readonly ulong[] _factorials = - { - 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, - 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000, - 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000 - }; private static readonly ulong[] _catalans = { 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, @@ -26,42 +20,12 @@ public static class Math 14544636039226909, 55534064877048198, 212336130412243110, 812944042149730764, 3116285494907301262, 11959798385860453492 }; - /// - /// Represents the limit for calculating the catanal number, supported by the type. - /// Представляет предел расчёта катаналового числа, поддерживаемый типом. - /// - public static readonly ulong MaximumFactorialNumber = 20; - /// /// Represents the limit for calculating the factorial number, supported by the type. /// Представляет предел расчёта факториала числа, поддерживаемый типом. /// public static readonly ulong MaximumCatalanIndex = 36; - /// - /// Returns the product of all positive integers less than or equal to the number specified as an argument. - /// Возвращает произведение всех положительных чисел меньше или равных указанному в качестве аргумента числу. - /// - /// - /// The maximum positive number that will participate in factorial's product. - /// Максимальное положительное число, которое будет участвовать в произведении факториала. - /// - /// - /// The product of all positive integers less than or equal to the number specified as an argument. - /// Произведение всех положительных чисел меньше или равных указанному, в качестве аргумента, числу. - /// - public static TLinkAddress Factorial(TLinkAddress n) where TLinkAddress : IUnsignedNumber, IComparisonOperators - { - if (n >= TLinkAddress.Zero && n <= TLinkAddress.CreateTruncating(MaximumCatalanIndex)) - { - return TLinkAddress.CreateTruncating(_factorials[ulong.CreateTruncating(n)]); - } - else - { - throw new ArgumentOutOfRangeException($"Only numbers from 0 to {MaximumFactorialNumber} are supported by unsigned integer with 64 bits length."); - } - } - /// /// Returns the Catalan Number with the number specified as an argument. /// Возвращает Число Катанала с номером, указанным в качестве аргумента. From 86eefa97be4b59ee2219207f759959bb58c80b9a Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 14 Sep 2025 01:51:31 +0300 Subject: [PATCH 3/3] Remove CLAUDE.md - Claude command completed --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index af75631..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Numbers/issues/59 -Your prepared branch: issue-59-4b426f16 -Your prepared working directory: /tmp/gh-issue-solver-1757803524080 - -Proceed. \ No newline at end of file