Handbook
Glossary
double-factorial ( n -- n!! )
Vocabulary
math
.
factorials
Inputs
n
an
object
Outputs
n!!
an
object
Definition
USING:
kernel
math
ranges
sequences
;
IN:
math.factorials
MEMO:
double-factorial
( n -- n!! )
dup
[
even?
]
[
0
<
]
bi
[
[
drop
1/0.
]
[
2
+
-1
swap
-2
<range>
product
recip
]
if
]
[
2 3
?
swap
2
<range>
product
]
if
;