public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/33595] FAIL: gfortran.dg/nint_2.f90  -O0  execution test
Date: Sun, 28 Dec 2008 22:16:00 -0000	[thread overview]
Message-ID: <20081228221441.13087.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33595-276@http.gcc.gnu.org/bugzilla/>



------- Comment #13 from kargl at gcc dot gnu dot org  2008-12-28 22:14 -------
(In reply to comment #12)
> Subject: Re:  FAIL: gfortran.dg/nint_2.f90  -O0  execution test
> 
> > See libm on FreeBSD.
> > 
> > http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/msun/src/s_roundf.c
> 
> So, the ceilf implementation was changed to a floorf implementation
> to correct rounding issues about three years ago...
> 
> I'll give it a try.  The default rounding mode on hpux is nearest.
> 

It also uses your idea or something very similar.  Notice the
changes in the if-statements.

        if (x >= 0.0) {
-               t = ceilf(x);
-               if (t - x > 0.5)
-                       t -= 1.0;
+               t = floorf(x);
+               if (t - x <= -0.5)
+                       t += 1.0;
                return (t);
        } else {
-               t = ceilf(-x);
-               if (t + x > 0.5)
-                       t -= 1.0;
+               t = floorf(-x);
+               if (t + x <= -0.5)
+                       t += 1.0;
                return (-t);
        }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33595


  parent reply	other threads:[~2008-12-28 22:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29 21:27 [Bug fortran/33595] New: " danglin at gcc dot gnu dot org
2007-10-01 13:13 ` [Bug fortran/33595] " fxcoudert at gcc dot gnu dot org
2007-10-01 16:33 ` dave at hiauly1 dot hia dot nrc dot ca
2007-10-01 16:39 ` fxcoudert at gcc dot gnu dot org
2007-10-01 17:29 ` dave at hiauly1 dot hia dot nrc dot ca
2007-12-22  7:38 ` jvdelisle at gcc dot gnu dot org
2008-12-04  3:05 ` billingd at gcc dot gnu dot org
2008-12-04  5:13 ` billingd at gcc dot gnu dot org
2008-12-28 20:26 ` danglin at gcc dot gnu dot org
2008-12-28 20:41 ` dave at hiauly1 dot hia dot nrc dot ca
2008-12-28 20:47 ` danglin at gcc dot gnu dot org
2008-12-28 21:03 ` kargl at gcc dot gnu dot org
2008-12-28 21:50 ` dave at hiauly1 dot hia dot nrc dot ca
2008-12-28 22:16 ` kargl at gcc dot gnu dot org [this message]
2008-12-29 17:12 ` danglin at gcc dot gnu dot org
2009-03-28  9:41 ` fxcoudert at gcc dot gnu dot org
2009-03-28 21:16 ` danglin at gcc dot gnu dot org
2009-03-29  7:36 ` [Bug libfortran/33595] " fxcoudert at gcc dot gnu dot org

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=20081228221441.13087.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).