- or download this
#!perl
use warnings; use strict;
- or download this
{ # a natural number represented as a Zeckendorf sum
package Zeckendorf;
- or download this
use warnings; use strict; use 5.012;
use Scalar::Util; use Math::BigInt;
...
$r;
}
- or download this
sub _norm {
...
}
- 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;
}
}
- or download this
{ # demonstrate
...
}
__END__