Created
August 10, 2020 11:03
-
-
Save 0xkohe/3892adcc05f1fd947330cbcf9686abb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fibMin(t1, t2 fibNum) (r fibNum) { | |
r1 := new(big.Rat).Add( | |
t1.num, | |
new(big.Rat).Mul(t2.num, big.NewRat(-1, 1)), | |
) | |
r2 := new(big.Rat).Add( | |
t1.numMultipliedBySR, | |
new(big.Rat).Mul(t2.numMultipliedBySR, big.NewRat(-1, 1)), | |
) | |
r.num = r1 | |
r.numMultipliedBySR = r2 | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment