|
Progression Library 0.0.1
A header only arithmetic, geometric and fibonacci progression library
|
Fibonacci Progression: each term is the sum of the previous two terms. More...
#include <progression.hpp>


Public Member Functions | |
| FibonacciPg (long f=0, long s=1) | |
| FibonacciPg constructor Takes two arguments first value and second value. | |
| long | first_value () override |
| sets the first value | |
| long | next_value () override |
| Calculates the next value in the progression. | |
| Public Member Functions inherited from Progression | |
| void | print_progression (int n) |
| Prints the first n terms of the progression. | |
| virtual | ~Progression ()=default |
| Virtual destructor to allow proper cleanup of derived objects. | |
Protected Attributes | |
| long | sec_v |
| second value | |
| long | prev |
| previous value | |
| Protected Attributes inherited from Progression | |
| long | curr |
| Current value in the progression. | |
| long | first |
| First value of the progression. | |
Fibonacci Progression: each term is the sum of the previous two terms.
| FibonacciPg::FibonacciPg | ( | long | f = 0, |
| long | s = 1 ) |
FibonacciPg constructor Takes two arguments first value and second value.
Fibonacci Progression.
| [in] | f | first value |
| [in] | s | second value Initialize f and s to 0 and 1 respectively |

|
overridevirtual |
sets the first value
Reimplemented from Progression.

|
overridevirtual |
Calculates the next value in the progression.
Implements Progression.