Fibonacci Linear
example_fibonacci_linear
¶
Overall description of this example goes here.
fst(_x: int, f: tuple[int, int]) -> int
¶
Get the first element of a pair.
:param x: A pair containing two integers. :return: The first element of the pair.
fib_zero_one() -> tuple[int, int]
¶
The pair of Fibonacci numbers at indices 0 and 1.
:return: The pair of Fibonacci numbers at indices 0 and 1.
fib_next(_y: int, _x: int, f: tuple[int, int]) -> tuple[int, int]
¶
Calculate the pair Fibonacci numbers at a given indices y and y + 1 using the pair of Fibonacci numbers at indices x = y - 1 and y.
:param _y: The indices for which the Fibonacci number is calculated. :param _x: The indices decremented by 1. :param f: The pair of Fibonacci numbers at indices y - 1 and y. :return: The pair of Fibonacci numbers at indices y and y + 1.