Mercurial > hg > Papers > 2019 > anatofuz-thesis
view paper/codes/fib.nqp @ 122:a3ff00c33fd7 default tip
update slide
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 20 Feb 2019 12:05:38 +0900 |
parents | 96e9cf9c2ea2 |
children |
line wrap: on
line source
#! nqp sub fib($n) { $n < 2 ?? $n !! fib($n-1) + fib($n - 2); } my $N := 29; my $t0 := nqp::time_n(); my $z := fib($N); my $t1 := nqp::time_n(); say("fib($N) = " ~ fib($N)); say("time = " ~ ($t1-$t0));