Fixed a comparison error when two different fractions evaluate to the same double due to limited precision. Jira: MATH-252