public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug math/3325] Implementation of fpmod should use fprem1, not fprem
Date: Wed, 21 Feb 2007 19:52:00 -0000	[thread overview]
Message-ID: <20070221195206.19261.qmail@sourceware.org> (raw)
In-Reply-To: <20061009175200.3325.jaredcasper@gmail.com>


------- Additional Comments From jakub at redhat dot com  2007-02-21 19:52 -------
Except that fmod{,f,l} as defined in ISO C99 and POSIX
requires the semantics that fprem provides.
E.g. ISO C99 in 7.12.10.1 says:
The fmod functions return the value x  - ny, for some integer n such that, if y
is nonzero, the result has the same sign as x and magnitude less than the
magnitude of y. If y is zero, whether a domain error occurs or the fmod
functions return zero is implementation-defined.
http://www.posix.nl/linuxassembly/nasmdochtml/nasmdoca.html
says fprem behaves exactly that way, while fprem1 rounds the division to nearest
and thus can return different sign of result from x, but result absolute value
won't be bigger than half of abs(y).
So, by changing fprem in fmod/fmodf/fmodl implementation to fprem1 you are
breaking e.g.
fmod (6.5, 2.25) which is supposed to return 2.0 (and was until now), while with
fprem1 it returns -0.25.

The patch has been reverted in CVS.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://sourceware.org/bugzilla/show_bug.cgi?id=3325

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2007-02-21 19:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09 17:52 [Bug math/3325] New: " jaredcasper at gmail dot com
2006-10-09 17:53 ` [Bug math/3325] " jaredcasper at gmail dot com
2007-02-18 13:22 ` aj at suse dot de
2007-02-19  5:49 ` drepper at redhat dot com
2007-02-21 19:52 ` jakub at redhat dot com [this message]
2007-02-21 20:04 ` jakub at redhat 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=20070221195206.19261.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /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).