Goodstein Sequence: Difference between revisions

Content deleted Content added
PureFox (talk | contribs)
m →‎{{header|Wren}}: Small change to output (N -> n)
Petelomax (talk | contribs)
m →‎{{header|Phix}}: report 32-bit limits properly
Line 170: Line 170:
end for
end for
printf(1,"\n")
printf(1,"\n")
integer m64 = machine_bits()=64, maxi = iff(m64?16:15), alim = iff(m64?13:12)
printf(1,"The Nth term of Goodstein(N) sequence counting from 0, for values of N from 0 through 16:\n")
printf(1,"The Nth term of Goodstein(N) sequence counting from 0, for values of N from 0 through %d:\n",maxi)
bool m64 = machine_bits()=64
for i=0 to iff(m64?16:15) do
for i=0 to maxi do
string ia = iff(i>=iff(m64?13:12)?" (inaccurate)":""),
string ia = iff(i>=alim?" (inaccurate)":""),
gs = shorten(sprintf("%d",goodstein(i,i+1)[$]))
gs = shorten(sprintf("%d",goodstein(i,i+1)[$]))
printf(1,"Term %d of Goodstein(%d): %s%s\n",{i,i,gs,ia})
printf(1,"Term %d of Goodstein(%d): %s%s\n",{i,i,gs,ia})