User Tools

Site Tools


factorials

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
factorials [2014/04/05 05:02]
127.0.0.1 external edit
factorials [2014/05/24 04:34] (current)
Jay.Tanner.x@PHPScienceLabs.us
Line 1: Line 1:
 ~~NOCACHE~~ ~~NOCACHE~~
 ~~DISCUSSION:​off~~ ~~DISCUSSION:​off~~
 +Back to:  **[[INDEX]]** ​ |  **[[Arbitrary-Precision Math]]**
 +-----
 =====Factorials===== =====Factorials=====
  
Line 88: Line 90:
  
 // Print out the computed table. // Print out the computed table.
-   print "<​b><​pre>​\nN ​  ​N!\n$FactorialTable</​pre></​b>​\n<​br><​br><​br>​"; +   print "<​b><​pre>​\nN ​  ​N!\n$FactorialTable</​pre></​b>​\n";​
- +
- +
-// =========================================================== +
-   ​function bcN_Factorial ($N=0) +
-+
-   $n = bcadd($N, 0); +
-    +
-   if (!is_numeric($n) or $n < 0 or $n > 9999) {return FALSE;} +
-    +
-   ​$P=1; ​ for ($i=1; ​ $i <= $n;  $i++) {$P = bcmul($P, $i);} +
-    +
-   ​return $P; +
-}+
  
 ?> ?>
Line 134: Line 123:
 // Print out the computed table. // Print out the computed table.
  
-   print "<​b><​pre>​\nN ​  ​N!\n$out</​pre></​b>​\n<​br><​br><​br>​";+   print "<​b><​pre>​\nN ​  ​N!\n$out</​pre></​b>​\n";​
  
- 
-   ​function bcN_Factorial ($N=0) 
-{ 
-   if (!is_numeric($N) or $N < 0 or $N > 9999) {return FALSE;} 
- 
-   $n = bcadd($N, 0); 
- 
-   ​$P=1; ​ for ($i=1; ​ $i <= $n;  $i++) {$P = bcmul($P, $i);} 
- 
-   ​return $P; 
-} 
 </​php>​ </​php>​
-**By examining the above table, ​you can see how rapidly the values of factorials increase.**+**By examining the above table, ​one can see how rapidly the values of factorials increase.**
 \\ \\ \\ \\
  
  
factorials.1396688537.txt.gz · Last modified: 2014/04/06 02:33 (external edit)