Mercurial > hg > truffle
view graal/com.oracle.truffle.sl.test/tests/Fibonacci.sl @ 13822:35fc64972250
fixed Linux compile error and removed name of not-yet-existing Windows Okra dll
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 30 Jan 2014 13:21:15 +0100 |
parents | b16ec83edc73 |
children | ff3136ecb5a7 |
line wrap: on
line source
function fib(num) { if (num < 1) {return 0;} n1 = 0; n2 = 1; i = 1; while (i < num) { next = n2 + n1; n1 = n2; n2 = next; i = i + 1; } return n2; } function main() { println(fib(42)); }