]> git.cameronkatri.com Git - mandoc.git/blob - regress/roff/de/factorial.in
delete the two pairs of extra blank lines from expected man(7) terminal
[mandoc.git] / regress / roff / de / factorial.in
1 .\" $OpenBSD: factorial.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $
2 .Dd $Mdocdate: July 4 2017 $
3 .Dt FACTORIAL 1
4 .Os
5 .Sh NAME
6 .Nm factorial
7 .Nd factorial sequence
8 .Sh DESCRIPTION
9 .\" recursively calculate a single factorial
10 .de rfac
11 . ie \\$1>1 \{\
12 . No \\$1 *
13 . nr i \\$1-1
14 . rfac \\ni
15 . nr acc \\n[acc]*\\$1
16 . \}
17 . el .nr acc 1
18 ..
19 .\" recursively print a sequence of factorials
20 .de fac
21 . No \\$1! =
22 . rfac \\$1
23 . if \\$1>1 1 =
24 . No \\n[acc]
25 . if \\$1 \{\
26 . br
27 . nr i \\$1-1
28 . fac \\ni
29 . \}
30 ..
31 .\" main program
32 .fac 9