This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/20916] pow handling of sNaN arguments


https://sourceware.org/bugzilla/show_bug.cgi?id=20916

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  90ab295a9e07fe4f6caaa9c19e03b3fba3f3e10d (commit)
      from  72d839a42f4c4ed2e0a5202a0d9829c3debae20f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=90ab295a9e07fe4f6caaa9c19e03b3fba3f3e10d

commit 90ab295a9e07fe4f6caaa9c19e03b3fba3f3e10d
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Dec 2 23:21:15 2016 +0000

    Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916).

    Various pow function implementations mishandle sNaN arguments in
    various ways.  This includes returning sNaN instead of qNaN for sNaN
    arguments.  For arguments (1, sNaN) and (sNaN, 0), TS 18661-1
    semantics are also that the result should be qNaN, whereas with a qNaN
    argument there the result should be 1, but for the dbl-64
    implementation of pow there are issues with sNaN arguments beyond not
    implementing the TS 18661-1 semantics in those special cases.

    This patch makes the implementations in sysdeps/ieee754 follow the TS
    18661-1 semantics consistently.  Because x86 / x86_64 implementations
    still need fixing, testcases are not included with this patch; they
    will be included with the fix for the x86 / x86_64 versions.

    Tested for x86_64, x86, mips64 and powerpc (with such testcases, which
    pass in the mips64 and powerpc cases).

        [BZ #20916]
        * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Do not return 1
        for arguments (sNaN, 0) or (1, sNaN).  Do arithmetic on NaN
        arguments to compute result.
        * sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Do not return
        1 for arguments (sNaN, 0) or (1, sNaN).
        * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Likewise.
        * sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                            |    9 +++++++++
 sysdeps/ieee754/dbl-64/e_pow.c       |   10 +++++-----
 sysdeps/ieee754/flt-32/e_powf.c      |    4 ++--
 sysdeps/ieee754/ldbl-128/e_powl.c    |    5 +++--
 sysdeps/ieee754/ldbl-128ibm/e_powl.c |    4 ++--
 5 files changed, 21 insertions(+), 11 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]