🚀 Get Started
🔧 Installation
Clone the repository and build it with cargo
:
git clone https://github.com/Tejtex/fib.git
cd fib
cargo build --release
The binary will be available at:
target/release/fib
▶️ Usage Examples
Here are some examples of how to use fib
:
# Generate 20th Fibonacci number
./fib 20
# Generate 20 Fibonacci numbers (default a=1, b=1)
./fib 20 --list
# Generate 20 Fibonacci numbers (default a=1, b=1) and plot them on a logarithmic scale
./fib 20 --list --plot
# Generate a custom sequence with initial values -1, 1
./fib 20 --init -1,1 --list
# Generate sequence with custom coefficients
./fib 10 --init 1,1 --coeffs 1,3 --list
# Use 3 previous elements (n-params)
./fib 10 --init 1,1,2 --n-params 3 --coeffs 1,1,1 --list
# Benchmark the binary
./fib 1000 --bench
# Show details instead of a giant number
./fib 10000 --details
# Generate 20th Fibonacci number modulo 10
./fib 20 --mod-x 10
💡 Notes
--n-params
controls how many previous values are used in the expression.--coeffs
controls the coefficients of each param. Example: ./fib 20 --coeffs 1,2 means f(n) = 1 * f(n-1) + 2 * f(n-2)--mod-x
is applied to each iteration not only to the last one
Project licensed under MIT. Made with ❤️ in Rust.