pub fn logarithmic_fibonacci(n: u32) -> u128 {
    // if it is the max value before overflow, use n-1 then get the second
    // value in the tuple
    if n == 186 {
        let (_, second) = _logarithmic_fibonacci(185);
        second
    } else {
        let (first, _) = _logarithmic_fibonacci(n);
        first
    }
}
/// logarithmic_fibonacci(n) returns the nth fibonacci number
/// This function uses the definition of Fibonacci where:
/// F(0) = 0, F(1) = 1 and F(n+1) = F(n) + F(n-1) for n>0
///
/// Warning: This will overflow the 128-bit unsigned integer at n=186


This will overflow the 128-bit unsigned integer at n=186
This will overflow the 128 - bit unsigned integer at n = 186
pub fn logarithmic_fibonacci(n: u32) -> u128 {
    // if it is the max value before overflow, use n-1 then get the second
    // value in the tuple
    if n == 186 {
        let (_, second) = _logarithmic_fibonacci(185);
        second
    } else {
        let (first, _) = _logarithmic_fibonacci(n);
        first
    }
}
pub fn logarithmic_fibonacci ( n : u32 ) -> u128 { // if it is the max value before overflow, use n-1 then get the second // value in the tuple if n == 186 { let ( _ , second ) = _logarithmic_fibonacci ( 185 ) ; second } else { let ( first , _ ) = _logarithmic_fibonacci ( n ) ; first } }
logarithmic_fibonacci(n) returns the nth fibonacci number
This function uses the definition of Fibonacci where:
F(0) = 0, F(1) = 1 and F(n+1) = F(n) + F(n-1) for n>0
logarithmic_fibonacci ( n ) returns the nth fibonacci number This function uses the definition of Fibonacci where : F ( 0 ) = 0 F ( 1 ) = 1 and F ( n + 1 ) = F ( n ) + F ( n - 1 ) for n > 0
n
u32
n
u32