Find limit of recursion: Difference between revisions

add tinybasic
(add tinybasic)
Line 478:
4/30</pre>
(The error code means "out of memory attempting to execute line <tt>30</tt>".)
 
==={{header|Tiny BASIC}}===
<lang Tiny BASIC>10 LET N = -32767
20 LET M = 0
30 LET N = N + 1
40 IF N = 32767 THEN LET M = M + 1
50 IF N = 32767 THEN PRINT M," x 2^16"
60 IF N = 32767 THEN LET N = -N
70 GOSUB 30</lang>
{{out}}
<pre>1 x 2^16
2 x 2^16
3 x 2^16
4 x 2^16
5 x 2^16
...
1645 x 2^16
1646 x 2^16
</pre>
I don't recommend actually running this; it will crash the computer.
 
==={{header|ZX Spectrum Basic}}===
781

edits