[jira] [Work logged] (NUMBERS-99) Fraction.add(int) and Fraction.subtract(int) ignore risk of integer overflow

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Work logged] (NUMBERS-99) Fraction.add(int) and Fraction.subtract(int) ignore risk of integer overflow

JIRA jira@apache.org

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

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

                Author: ASF GitHub Bot
            Created on: 24/May/19 10:46
            Start Date: 24/May/19 10:46
    Worklog Time Spent: 10m
      Work Description: Schamschi commented on pull request #34: [NUMBERS-99] Implement integer overflow checks
URL: https://github.com/apache/commons-numbers/pull/34
 
 
   
 
----------------------------------------------------------------
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:
[hidden email]


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

    Worklog Id:     (was: 247980)
    Time Spent: 20m  (was: 10m)

> Fraction.add(int) and Fraction.subtract(int) ignore risk of integer overflow
> ----------------------------------------------------------------------------
>
>                 Key: NUMBERS-99
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-99
>             Project: Commons Numbers
>          Issue Type: Bug
>          Components: fraction
>            Reporter: Heinrich Bohne
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The methods {{add(int)}} and {{subtract(int)}} in the class {{org.apache.commons.numbers.fraction.Fraction}} do not take into account the risk of an integer overflow. For example, (2​^31^ - 1)/2 + 1 = (2​^31^ + 1)/2, so the numerator overflows an {{int}}, but when calculated with {{Fraction.add(int)}}, the method still returns normally.



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