Talk:Fibonacci matrix-exponentiation: Difference between revisions
Talk:Fibonacci matrix-exponentiation (view source)
Revision as of 11:40, 8 June 2023
, 11 months ago→Ruby
(→Ruby) |
|||
Line 18:
require 'matrix'
start_time = Time.now
[10,100,1_000,10_000, 2 ** 16, 100_000, 1_000_000,10_000_000, 2 ** 32 ].each {|n|
fib_Num=(Matrix[[0,1],[1,1]] ** (n))[0,1]
fib_Str= fib_Num.to_s()
|