[ 
https://issues.apache.org/jira/browse/NUMBERS-127?focusedWorklogId=270324&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-270324
 ]

ASF GitHub Bot logged work on NUMBERS-127:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Jul/19 17:25
            Start Date: 01/Jul/19 17:25
    Worklog Time Spent: 10m 
      Work Description: asfgit commented on pull request #62: NUMBERS-127: 
Fraction(int, int): Negate numerator and denominator onl…
URL: https://github.com/apache/commons-numbers/pull/62
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 270324)
    Time Spent: 0.5h  (was: 20m)

> Fraction(int, int) rejects possibly reducible numerator or denominator 2^-31
> ----------------------------------------------------------------------------
>
>                 Key: NUMBERS-127
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-127
>             Project: Commons Numbers
>          Issue Type: Bug
>          Components: fraction
>    Affects Versions: 1.0
>            Reporter: Heinrich Bohne
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Since the sign of a fraction is held by the numerator, it is possible that 
> the values passed as numerator and denominator need to be negated. This is 
> not possible for 2^-31 due to overflow, so the constructor throws an 
> exception in this case. However, the constructor forgets that this value 
> might be reducible if the passed numerator and denominator are not coprime, 
> so it rejects values where the representation in lowest terms would not 
> overflow.
> Also, the check whether the denominator is negative and the corresponding 
> negation of the numerator and denominator is coded twice, with the second 
> conditional block being dead code because the sign has already been moved to 
> the numerator by then.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to