Skip to content

Instantly share code, notes, and snippets.

@0xkohe
Created August 10, 2020 11:03
Show Gist options
  • Save 0xkohe/3892adcc05f1fd947330cbcf9686abb6 to your computer and use it in GitHub Desktop.
Save 0xkohe/3892adcc05f1fd947330cbcf9686abb6 to your computer and use it in GitHub Desktop.
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