fork download
  1. #!/usr/bin/perl
  2. use bigint;
  3.  
  4. my ($a, $b) = (0, 1);
  5. for (;
  6. {
  7. print "$an";
  8. ($a,$b) = ($b,$a+$b);
  9. }
  10. sub fibo;
  11. sub fibo {$_ [0] < 2 ? $_ [0] : fibo ($_ [0] - 1) + fibo ($_ [0] - 2)}
  12.  
  13. Iterative
  14.  
  15. sub fibo
  16. {
  17. my ($n, $a, $b) = (shift, 0, 1);
  18. ($a, $b) = ($b, $a + $b) while $n-- > 0;
  19. $a;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
===SORRY!===
Unable to find module 'bigint' in the @*INC directories.
(@*INC contains:
  /home/MdKcB2/.perl6/lib
  /usr/lib/parrot/2.7.0/languages/perl6/lib
  .)
stdout
Standard output is empty