projects
/
LeanCalc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
focus expression text field at startup -> version 1.2
[LeanCalc.git]
/
help
/
fact
1
NAME
2
fact - factorial
3
4
SYNOPSIS
5
fact(x)
6
7
TYPES
8
x int
9
10
return int
11
12
DESCRIPTION
13
Return the factorial of a number. Factorial is defined as:
14
15
x! = 1 * 2 * 3 * ... * x-1 * x
16
0! = 1
17
18
EXAMPLE
19
> print fact(10), fact(5), fact(2), fact(1), fact(0)
20
3628800 120 2 1 1
21
22
> print fact(40)
23
815915283247897734345611269596115894272000000000
24
25
LIMITS
26
2^24 > x >= 0
27
y < 2^24
28
29
LINK LIBRARY
30
void zfact(NUMBER x, *ret)
31
32
SEE ALSO
33
comb, perm
34