Stirling numbers of the first kind: Difference between revisions
m
→{{header|ALGOL 68}}: Adjusted output to avoid line-wrap
m (→{{header|ALGOL W}}: Adjust output to avoid line-wrap) |
m (→{{header|ALGOL 68}}: Adjusted output to avoid line-wrap) |
||
Line 115:
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32}}
Uses the Algol 68G LONG LONG INT mode which provides large-precision integers. As the default number of digits is insufficient for the task, the maximum nunber of digits is specified by a pragmatic comment.
<syntaxhighlight lang="algol68">
# specify the precision of LONG LONG INT, we need about 160 digits #
Line 145:
REF[,]SINT s1 = make s1( max stirling, FALSE );
print( ( "Unsigned Stirling numbers of the first kind:", newline ) );
print( ( " k 0" ) );
FOR k
print( ( newline, " n", newline ) );
FOR n FROM 0 TO max stirling DO
print( ( whole( n, -2 ), whole( s1[ n, 0 ], -3 ) ) );
FOR k
print( ( whole( s1[ n, k ], IF k < 6 THEN -10 ELSE -9 FI ) ) )
OD;
print( ( newline ) )
Line 167:
print( ( whole( max 100, 0 ), newline ) )
END
END
{{out}}
<pre>
Unsigned Stirling numbers of the first kind:
k
n
0
1
2
3
4
5
6
7
8
9
10
11
12
Maximum Stirling number of the first kind with n = 100:
19710908747055261109287881673376044669240511161402863823515728791076863288440277983854056472903481625299174865860036734731122707870406148096000000000000000000
|