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

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

                Author: ASF GitHub Bot
            Created on: 22/Jun/19 02:32
            Start Date: 22/Jun/19 02:32
    Worklog Time Spent: 10m 
      Work Description: Schamschi commented on issue #56: NUMBERS-119: Correct 
bug in BigFraction(double) constructor
URL: https://github.com/apache/commons-numbers/pull/56#issuecomment-504619638
 
 
   Interesting, the code coverage decreased, but not because of the special 
case I added for subnormal numbers (this was already covered by a test that 
only tested the numerator but not the denominator, which is why the test did 
not fail), but because I also made a special case for zero that caused the 
denominator of the created fraction to be set to 1 (so that the fraction is 
0/1) instead of 2^1075. For some reason, this caused a branch in the method 
reduce() not to be executed by tests anymore …
 
----------------------------------------------------------------
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: 265161)
    Time Spent: 0.5h  (was: 20m)

> BigFraction(double) constructor does not treat subnormal numbers correctly
> --------------------------------------------------------------------------
>
>                 Key: NUMBERS-119
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-119
>             Project: Commons Numbers
>          Issue Type: Bug
>          Components: fraction
>    Affects Versions: 1.0
>            Reporter: Heinrich Bohne
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The constructor {{BigFraction(double)}} does not take into account the fact 
> that, when the biased exponent of a {{double}} value is {{0}} and the 
> mantissa is not {{0}} (i.e. when the value represents a subnormal number), 
> the actual exponent in effect is not {{-1023}} but {{-1022}} (or, in other 
> words, the effective exponent bias is not {{1023}} but {{1022}}).
> The value of the created {{BigFraction}} is therefore not equal to the value 
> of the passed {{double}} argument.



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

Reply via email to