[jira] Created: (MATH-502) FastMath scalb() does not handle large magnitude exponents correctly

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-502) FastMath scalb() does not handle large magnitude exponents correctly

JIRA jira@apache.org
FastMath scalb() does not handle large magnitude exponents correctly
--------------------------------------------------------------------

                 Key: MATH-502
                 URL: https://issues.apache.org/jira/browse/MATH-502
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 2.2, 3.0
            Reporter: Sebb
             Fix For: 2.2, 3.0


scalb does not handle MAX_VALUE exponents properly:

double scalb(-1.7976931348623157E308, 2147483647) expected -Infinity actual -8.988465674311579E307 entries [6, 5]
double scalb(1.7976931348623157E308, 2147483647) expected Infinity actual 8.988465674311579E307 entries [7, 5]
double scalb(-1.1102230246251565E-16, 2147483647) expected -Infinity actual -5.551115123125783E-17 entries [8, 5]
double scalb(1.1102230246251565E-16, 2147483647) expected Infinity actual 5.551115123125783E-17 entries [9, 5]
double scalb(-2.2250738585072014E-308, 2147483647) expected -Infinity actual -0.0 entries [10, 5]
double scalb(2.2250738585072014E-308, 2147483647) expected Infinity actual 0.0 entries [11, 5]

float scalb(3.4028235E38, 2147483647) expected Infinity actual 1.7014117E38 entries [7, 5]
float scalb(-3.4028235E38, 2147483647) expected -Infinity actual -1.7014117E38 entries [9, 5]

It looks as though the problem is with the calculation of the scaledExponent - for large values, this can wrap round, so some of the checks against its value may give misleading results.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MATH-502) FastMath scalb() does not handle large magnitude exponents correctly

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MATH-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe resolved MATH-502.
--------------------------------

    Resolution: Fixed

fixed in subversion repository as of r1062928 for trunk and r1062929 for branch 2.X

> FastMath scalb() does not handle large magnitude exponents correctly
> --------------------------------------------------------------------
>
>                 Key: MATH-502
>                 URL: https://issues.apache.org/jira/browse/MATH-502
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.2, 3.0
>            Reporter: Sebb
>             Fix For: 2.2, 3.0
>
>
> scalb does not handle MAX_VALUE exponents properly:
> double scalb(-1.7976931348623157E308, 2147483647) expected -Infinity actual -8.988465674311579E307 entries [6, 5]
> double scalb(1.7976931348623157E308, 2147483647) expected Infinity actual 8.988465674311579E307 entries [7, 5]
> double scalb(-1.1102230246251565E-16, 2147483647) expected -Infinity actual -5.551115123125783E-17 entries [8, 5]
> double scalb(1.1102230246251565E-16, 2147483647) expected Infinity actual 5.551115123125783E-17 entries [9, 5]
> double scalb(-2.2250738585072014E-308, 2147483647) expected -Infinity actual -0.0 entries [10, 5]
> double scalb(2.2250738585072014E-308, 2147483647) expected Infinity actual 0.0 entries [11, 5]
> float scalb(3.4028235E38, 2147483647) expected Infinity actual 1.7014117E38 entries [7, 5]
> float scalb(-3.4028235E38, 2147483647) expected -Infinity actual -1.7014117E38 entries [9, 5]
> It looks as though the problem is with the calculation of the scaledExponent - for large values, this can wrap round, so some of the checks against its value may give misleading results.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (MATH-502) FastMath scalb() does not handle large magnitude exponents correctly

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MATH-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe closed MATH-502.
------------------------------


Closing issue as it was included in version 2.2, which has been released

> FastMath scalb() does not handle large magnitude exponents correctly
> --------------------------------------------------------------------
>
>                 Key: MATH-502
>                 URL: https://issues.apache.org/jira/browse/MATH-502
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.2, 3.0
>            Reporter: Sebb
>             Fix For: 2.2, 3.0
>
>
> scalb does not handle MAX_VALUE exponents properly:
> double scalb(-1.7976931348623157E308, 2147483647) expected -Infinity actual -8.988465674311579E307 entries [6, 5]
> double scalb(1.7976931348623157E308, 2147483647) expected Infinity actual 8.988465674311579E307 entries [7, 5]
> double scalb(-1.1102230246251565E-16, 2147483647) expected -Infinity actual -5.551115123125783E-17 entries [8, 5]
> double scalb(1.1102230246251565E-16, 2147483647) expected Infinity actual 5.551115123125783E-17 entries [9, 5]
> double scalb(-2.2250738585072014E-308, 2147483647) expected -Infinity actual -0.0 entries [10, 5]
> double scalb(2.2250738585072014E-308, 2147483647) expected Infinity actual 0.0 entries [11, 5]
> float scalb(3.4028235E38, 2147483647) expected Infinity actual 1.7014117E38 entries [7, 5]
> float scalb(-3.4028235E38, 2147483647) expected -Infinity actual -1.7014117E38 entries [9, 5]
> It looks as though the problem is with the calculation of the scaledExponent - for large values, this can wrap round, so some of the checks against its value may give misleading results.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira