|
D.2.2.6 factorial
Procedure from library general.lib (see general_lib).
- Usage:
- factorial(n[,p]); n,p integers
- Return:
- factorial(n): n! (computed in characteristic 0), of type string.
factorial(n,p): n! computed in characteristic 0 or prime(p)
- of type number if a basering is present and 0=p=char(basering)
or if prime(p)=char(basering)
- of type string else
Example:
| LIB "general.lib";
factorial(37);""; //37! of type string (as long integer)
==> 13763753091226345046315979581580902400000000
==>
ring r1 = 0,x,dp;
number p = factorial(37,0); //37! of type number, computed in r
p;
==> 13763753091226345046315979581580902400000000
| See also:
prime.
|