Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chris Ward provided this useful suggestion about the Fraction.divide code: "(a/b)/(c/d) == (a/b)*(d/c). Instead of using expensive division operations, and commonly converting one or both of the numerator and denominator into floats, simply invert the divisor and call the multiply function." I implemented the change and was happy to find an approximate 2.5x speedup in division operations and an end to common rounding errors which had plagued the implementation. Thanks Chris!
- Loading branch information