[ https://issues.apache.org/jira/browse/NUMBERS-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Heinrich Bohne updated NUMBERS-122: ----------------------------------- Description: The helper methods {{assertFraction(int, int, BigFraction)}} and {{assertFraction(long, long, BigFraction)}} don't check whether the numerator and denominator of the {{BigFraction}} are equivalent to the first two arguments. Rather, they check whether the numerator and denominator _truncated to an {{int}} or {{long}}_ are equal to the first two arguments. This is unsatisfactory and also probably not in the spirit of the creator of these methods. Also, the method {{assertFraction(int, int, BigFraction)}} is redundant, because an {{int}} can be cast to a {{long}} without loss of precision, so {{assertFraction(long, long, BigFraction)}} is sufficient to handle both {{int}} and {{long}} arguments. was:The helper methods {{assertFraction(int, int, BigFraction)}} and {{assertFraction(long, long, BigFraction)}} don't check whether the numerator and denominator of the {{BigFraction}} are equivalent to the first two arguments. Rather, they check whether the numerator and denominator _truncated to an {{int}} or {{long}}_ are equal to the first two arguments. This is unsatisfactory and also probably not in the spirit of the creator of these methods. > Helper assertion methods in BigFractionTest not strict enough > ------------------------------------------------------------- > > Key: NUMBERS-122 > URL: https://issues.apache.org/jira/browse/NUMBERS-122 > Project: Commons Numbers > Issue Type: Bug > Components: fraction > Affects Versions: 1.0 > Reporter: Heinrich Bohne > Priority: Minor > > The helper methods {{assertFraction(int, int, BigFraction)}} and > {{assertFraction(long, long, BigFraction)}} don't check whether the numerator > and denominator of the {{BigFraction}} are equivalent to the first two > arguments. Rather, they check whether the numerator and denominator > _truncated to an {{int}} or {{long}}_ are equal to the first two arguments. > This is unsatisfactory and also probably not in the spirit of the creator of > these methods. > Also, the method {{assertFraction(int, int, BigFraction)}} is redundant, > because an {{int}} can be cast to a {{long}} without loss of precision, so > {{assertFraction(long, long, BigFraction)}} is sufficient to handle both > {{int}} and {{long}} arguments. -- This message was sent by Atlassian JIRA (v7.6.3#76005)