Math::Fibonacci::Phi - Perl extension for calculating Phi and phi for Fibonacci numbers.
use Math::Fibonacci::Phi; use Math::Fibonacci::Phi qw(Phi phi); use Math::Fibonacci::Phi ':all'
None by default. Everything in the function section below can be imported and ':all' will do all functions.
Calculates and returns Phi (The Golden Number) for the given Fibonacci Number. It returns undef if the argument is not part of the Fibonacci sequence.
Calculates and returns phi (opposite of Phi, antiPhi) for the given Fibonacci Number. It returns undef if the argument is not part of the Fibonacci sequence.
Returns a hashref of the first $n Fibonacci Numbers where each key is the Fibonacci and the value is its Phi.
Returns a hashref of the first $n Fibonacci Numbers where each key is the Fibonacci and the value is its phi.
Returns Phi for the $nth Fibonacci number.
Returns phi for the $nth Fibonacci number.
Returns a hashref of the first $n Fibonacci Numbers where each key is the Fibonacci and the value is a hashref that has these 3 keys:
'Phi', 'phi', and 'position'
'position' is its location in the sequence (IE same number as the argument you'd give to term_Phi() or term_phi() )
This can be a number from 1 - 14 to specify the decimal precision you'd like.
use Math::Fibonacci::Phi 'Phi'; print Phi(5), "\n"; $Math::Fibonacci::Phi::Precision = 7; print Phi(5), "\n";
result is:
1.66666666666667 1.6666667
If $Math::Fibonacci::Phi::Precision is set then you can set this to true to keep the trailing zeros.
use Math::Fibonacci::Phi 'Phi'; $Math::Fibonacci::Phi::Precision = 5; print Phi(3), "\n"; $Math::Fibonacci::Phi::TrailingZeros=1 print Phi(3), "\n";
1.5 1.50000
Math::Fibonacci
Daniel Muey, http://drmuey.com/cpan_contact.pl
Copyright 2005 by Daniel Muey
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Math::Fibonacci::Phi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Fibonacci::Phi
CPAN shell
perl -MCPAN -e shell install Math::Fibonacci::Phi
For more information on module installation, please visit the detailed CPAN module installation guide.