Help for this page

Select Code to Download


  1. or download this
    #!perl
    use warnings; use strict;
    
  2. or download this
    { # a natural number represented as a Zeckendorf sum
    package Zeckendorf;
    
  3. or download this
    use warnings; use strict; use 5.012;
    use Scalar::Util; use Math::BigInt;
    ...
        $r;
    }
    
  4. or download this
    
    sub _norm {
    ...
    }
    
  5. or download this
    if (0) { # perform some random tests on the Zeckendorf class. disabled
    + by default because slow.
        for my $i (1 .. 100) {
    ...
            $s == $z->val or die;
        }
    }
    
  6. or download this
    
    { # demonstrate
    ...
    }
    
    __END__