File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
Platform.Numbers.Benchmarks Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,28 @@ public long FactorialUsingRecursion()
1414 return Math . Factorial ( FACTORIALTESTNUMBER ) ;
1515 }
1616
17+ [ Benchmark ]
18+ public long FactorialRecursionCountingArraylength ( )
19+ {
20+ return Math . FactorialRecursionCountingArraylength ( FACTORIALTESTNUMBER ) ;
21+ }
22+
1723 [ Benchmark ]
1824 public long FactorialUsingFactTree ( )
1925 {
2026 return Math . FactTree ( FACTORIALTESTNUMBER ) ;
2127 }
2228
2329 [ Benchmark ]
24- public long FactorialRecursionCountingArraylength ( )
30+ public long FactorialOnly21 ( )
2531 {
26- return Math . FactorialRecursionCountingArraylength ( FACTORIALTESTNUMBER ) ;
32+ return Math . FactorialOnly21 ( FACTORIALTESTNUMBER ) ;
33+ }
34+
35+ [ Benchmark ]
36+ public long FactorialOf19 ( )
37+ {
38+ return Math . FactorialOf19 ( FACTORIALTESTNUMBER ) ;
2739 }
2840
2941 [ Benchmark ]
Original file line number Diff line number Diff line change @@ -79,6 +79,22 @@ public static long FactorialRecursionCountingArraylength(long n)
7979 return n * Factorial ( n - 1 ) ;
8080 }
8181
82+ /// <summary>
83+ /// <para>Generate the factorial of the value "n".</para>
84+ /// <para>Генерация факториaла из значения переменной "n".</para>
85+ /// </summary>
86+ /// <param name="n"><para>Factorial generation value.</para><para>Значение генерации факториала.</para></param>
87+ /// <returns><para>Result of factorial calculation.</para><para>Результат подсчета факториала</para></returns>
88+ public static long FactorialOnly21 ( long n )
89+ {
90+ return _factorials [ n ] ;
91+ }
92+
93+ public static long FactorialOf19 ( long n )
94+ {
95+ return 121645100408832000 ;
96+ }
97+
8298 /// <summary>
8399 /// <para>Generate the factorial of the value "n".</para>
84100 /// <para>Генерация факториaла из значения переменной "n".</para>
You can’t perform that action at this time.
0 commit comments