Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        return 1 if $num<3;
        return fibo($num-1) + fibo($num-2);
    }
    
  2. or download this
    $ perl fibo.pl
    fib(1)=1  (6e-06 sec)
    ...
    fib(40)=102334155  (38.201329 sec)
    fib(41)=165580141  (62.30559 sec)
    ^C
    
  3. or download this
    use Memoize;
    memoize('fibo');
    
  4. or download this
    $ perl fibo.pl
    fib(1)=1  (8e-06 sec)
    ...
    fib(98)=1.35301852344707e+20  (6e-06 sec)
    fib(99)=2.18922995834555e+20  (6e-06 sec)
    fib(100)=3.54224848179262e+20  (6e-06 sec)