Top
Back: D.2.2.5 deleteSublist
Forward: D.2.2.7 fibonacci
FastBack: Appendix D SINGULAR libraries
FastForward: E Release Notes
Up: D.2.2 general_lib
Top: 1 Preface
Contents: Table of Contents
Index: F Index
About: About This Document

D.2.2.6 factorial

Procedure from library general.lib (see section 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.


Top Back: D.2.2.5 deleteSublist Forward: D.2.2.7 fibonacci FastBack: Appendix D SINGULAR libraries FastForward: E Release Notes Up: D.2.2 general_lib Top: 1 Preface Contents: Table of Contents Index: F Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texinfo.