Re:Tail recursion, but modulo cons
by tome on Friday March 04, 2022 @06:39AM
(#30553381)
> You can exponentiate the matrix n-1 times to get a matrix that converts F_1 and F_0 (known in advance) into F_n and F_{n-1}. This is just as amenable to the shortcuts involved in calculating large exponents of a value as exponentiating ϕ is. But it's exact integer arithmetic.
Right, and repeated squaring can give you the answer to the exponentiation in logarithmic time.
Right, and repeated squaring can give you the answer to the exponentiation in logarithmic time.