View in color | License | Download script | History |
19-Mar 2:03 UTC
[0.048] 9.983k
[0.048] 9.983k
factorial.rREBOL [
Title: "Factorial"
Date: 6-Jan-1999
File: %factorial.r
Author: "Ken Lake"
Purpose: "Compute a factorial"
Comment: {
This program uses a recursive algorithm to compute factorials.
usage: ! [a]
example ! 5
120
}
library: [
level: 'intermediate
platform: none
type: none
domain: 'math
tested-under: none
support: none
license: none
see-also: none
]
]
!: func [a] [return either a > 1 [a * ! (a - 1)] [1]]
print ! 5 |