Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Zeckendorf representation

by ambrus (Abbot)
on Aug 25, 2012 at 11:38 UTC ( #989716=note: print w/ replies, xml ) Need Help??

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__
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989716]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-08-30 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls