Stirling numbers of the second kind: Difference between revisions
Stirling numbers of the second kind (view source)
Revision as of 10:03, 24 March 2024
, 2 months ago→{{header|ALGOL 68}}: Reduce output width to avoid line-wrap
m (→{{header|ALGOL W}}: Reduce output width to avoid line-wrap) |
m (→{{header|ALGOL 68}}: Reduce output width to avoid line-wrap) |
||
Line 104:
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32}}
Uses the LONG LONG INT mode of Algol 68g which allows large precision integers. As the default precision of LONG LONG INT is too small, the precision is specified via a pragmatic comment.
<syntaxhighlight lang="algol68">
# specify the precision of LONG LONG INT, somewhat under 160 digits are #
Line 132:
print( ( "Stirling numbers of the second kind:", newline ) );
print( ( " k" ) );
FOR k FROM 0 TO max stirling DO print( ( whole( k, -
print( ( newline, " n", newline ) );
FOR n FROM 0 TO max stirling DO
print( ( whole( n, -2 ) ) );
FOR k FROM 0 TO n DO
print( ( whole( s2[ n, k ], -
OD;
print( ( newline ) )
Line 153:
print( ( whole( max 100, 0 ), newline ) )
END
END
{{out}}
<pre>
Stirling numbers of the second kind:
k
n
0
1
2
3
4
5
6
7
8
9
10
11
12
Maximum Stirling number of the second kind with n = 100:
7769730053598745155212806612787584787397878128370115840974992570102386086289805848025074822404843545178960761551674
|