Math::Fibonacci(3pm)
π Math::Fibonacci π
okay bestie, pull up a chair, because today we're talking about the perl manual page for Math::Fibonacci β like, the User Contributed Perl Documentation one? yeah, that one. Fibonacci numbers, but make it perl. no cap, we're doing math and it's gonna slay. π¦
β¨ NAME β¨
Math::Fibonacci β it's Fibonacci numbers, babe. that's the whole vibe. πΈ
π VERSION π
$Revision: 1.5 $
that's it, that's the version, noted and archived, periodt. π
π SYNOPSIS π
okay so here's how you actually use it, copy-paste girlies rise:
use Math::Fibonacci qw(term series decompose);
my $term = term ( 42 );
my @series = series ( 42 );
my @sum = decompose ( 65535 );
look how cute that is. you import term, series, and decompose, then you justβ¦ ask for stuff. iconic behaviour honestly. β¨
π₯ DESCRIPTION π₯
This module provides a few functions related to Fibonacci numbers. that's it, that's the summary, no essays, just vibes and numbers. π§
π EXPORTS ON REQUEST π
here's what you can ask it to hand over when you use it β bestie, they're opt-in, so you gotta name them yourself:
term()series()decompose()isfibonacci()
(no commas between them in the original list, and honestly? we respect the chaos. π)
π FUNCTIONS π
term($n)
Returns the $n-th term of the Fibonacci sequence. β¨
and here's the juicy part β it's computed with the fast algorithm:
F(n) ~ g^n/sqrt(5)
where g is the golden ratio, and that little ~ means "take the nearest integer". so it's not summing a billion tiny numbers, it just β¨ vibes β¨ its way to the answer. main character energy fr fr. π
series($n)
Computes and returns the first $n Fibonacci numbers. a whole lineup. a little squad. π«Ά
decompose($int)
Decomposes $int into the sum of Fibonacci numbers. Returns the list of Fibonacci numbers. it takes your big number apart like unboxing haul and hands you back the pieces. π
isfibonacci($int)
Returns the sequence number of $int if it is a Fibonacci number β or a non-true value if it is not. so basically a vibe check for numbers: either it tells you where it sits in the lineup, or it simply does not. π
π AUTHOR π
Vipul Ved Prakash, <mail@vipul.net> β give them their flowers, they wrote the whole thing. πΈ
π LICENSE π
Copyright (c) 1999-2001, Vipul Ved Prakash.
This code is free software; you can redistribute it and/or modify it under the ARTISTIC license (a copy is included in the distribution) or under the same terms as Perl itself. so like, go wild, just read the license first, bestie. π
also real quick β the SEE ALSO section? yeah, there isn't one. the page just ends. no extra reading, we're free. ποΈ
and that's the whole page, bestie!! this was Math::Fibonacci, documented for perl v5.36.0, dated 2022-10-15, and you read it top to bottom like a scholar. so proud. go compute some Fibonacci numbers and text me the results. mwah. πβ¨π
π¦πΈπ
π¦ where this page comes from
- ubuntu noble: libmath-fibonacci-perl 1.5-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmath-fibonacci-perl 1.5-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmath-fibonacci-perl 1.5-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms