public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jsm28 at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug math/18031] New: [ldbl-128ibm] modfl problems
Date: Wed, 25 Feb 2015 23:07:00 -0000	[thread overview]
Message-ID: <bug-18031-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 18031
           Summary: [ldbl-128ibm] modfl problems
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org

The ldbl-128ibm implementation of modfl has several issues:

* In the case for high part exponent < 52,
(((i0&i)|(i1&0x7fffffffffffffffLL))==0) is not a correct test for integer
argument; the latter part effectively tests just if the low part is a power of
2.  Example: an argument of 0x1.ffffffffffffffp51L is wrongly treated as being
an integer.

* In that case, the handling of non-integers when detected as such fails to
allow for the low part being of opposite sign to the integer high part. 
Example: 0x1.ffffffffffffff1p51L produces integer part 0x1p+52, fractional part
-0x1.ep-6.

* The case of high part exponent > 103 is treated as meaning the argument is an
integer, but that's not true even when restricted to numbers with 106
contiguous mantissa bits.  Example: 0x1.ffffffffffffffffffffffffff8p104L is
wrongly treated as being an integer.

* In the case for exponents 52 to 103, the test i1&i)==0 for being an integer
is completely bogus; the mask i = -1ULL>>(j0-52) is computed as if this were a
conventional IEEE format.  Example: 0x0.fffffffffffffcp52L is wrongly treated
as being an integer.

* When something is detected as not an integer in that case, the INSERT_WORDS64
(xlo, i1&(~i)) is always inserting a subnormal / zero value in the low part,
its exponent having been masked off earlier.  Example:
0x1.00000000000001111p56L gets integer part 0x1p+56 and fractional part
0x1.111p+0, which is more than 1.

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


             reply	other threads:[~2015-02-25 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 23:07 jsm28 at gcc dot gnu.org [this message]
2020-08-13 11:37 ` [Bug math/18031] " jakub at redhat dot com
2020-08-13 15:26 ` fw at deneb dot enyo.de
2024-04-24  7:04 ` amodra at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-18031-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).