Helper function that calculates F [ ] [ ] raise to the power n and puts the result in F [ ] [ ] Note that this function is designed only for fib ( ) and won 't work as general power function
function power ( F , n , m ) { if ( n == 0 n == 1 ) return ; let M = [ [ 1 , 1 ] , [ 1 , 0 ] ] ; power ( F , Math . floor ( n / 2 ) , m ) ; multiply ( F , F , m ) ; if ( n % 2 != 0 ) multiply ( F , M , m ) ; }