Ackermann function: Difference between revisions
Content deleted Content added
→{{header|Go}}: add sub-sections; remove unsafe usage; recover from panic; add A(3,1e6) and A(4,2) |
|||
Line 4,043:
</lang>
=={{header|
<lang
#! /usr/local/bin/newlisp
(define (ackermann m n)
(cond ((zero? m) (inc n))
]</lang>▼
((zero? n) (ackermann (dec m) 1))
(true (ackermann (- m 1) (ackermann m (dec n))))))
<pre>
In case of stack overflow error, you have to start your program with a proper "-s <value>" flag
as "newlisp -s 100000 ./ackermann.lsp".
See http://www.newlisp.org/newlisp_manual.html#stack_size
</pre>
=={{header|Nim}}==
|