Libraryless. Click here for Pure Java version (2583L/16K).
static BigInt ackermann(BigInt a, BigInt b) { if (a.equals(BigInt.ZERO)) ret plus(b, BigInt.ONE); if (b.equals(BigInt.ZERO)) ret ackermann(a.subtract(BigInt.ONE), BigInt.ONE); ret ackermann(minus(a, BigInt.ONE), ackermann(a, minus(b, BigInt.ONE))); }
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030372 |
Snippet name: | ackermann [Ackermann function] |
Eternal ID of this version: | #1030372/2 |
Text MD5: | 8b2d1618378e21103ace21ae140956a3 |
Transpilation MD5: | 4e37eefd2853293c7e4a1e054a1d5dea |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-12-10 12:57:43 |
Source code size: | 270 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 252 / 333 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1030373 - Turn Ackermann function into a virtual stack [OK] #1030380 - ackermann_int [Ackermann function on ints] |