On Wed, Sep 5, 2012 at 9:35 AM, Abigail <abig...@abigail.be> wrote:
> Your first instinct should be "Is there a generating function I can use?".

Try not to blow your cache pipeline with all that silly branching,

sub fib {
  my $n = shift;
  int(0.5 + (0.5+0.5*sqrt 5) ** $n / sqrt 5);
}

High five! :-)

Paul

Reply via email to