Top
Back: deleteSublist
Forward: fibonacci
FastBack: all_lib
FastForward: inout_lib
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

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)
ring r1 = 0,x,dp;
number p = factorial(37,0);       //37! of type number, computed in r
p;
prime


Top Back: deleteSublist Forward: fibonacci FastBack: all_lib FastForward: inout_lib Up: general_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-0-1, October 2005, generated by texi2html.