public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "danglin 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 20:26:00 -0000 [thread overview] Message-ID: <20081228202517.13112.qmail@sourceware.org> (raw) In-Reply-To: <bug-33595-276@http.gcc.gnu.org/bugzilla/> ------- Comment #8 from danglin at gcc dot gnu dot org 2008-12-28 20:25 ------- The value calculated for b = nearest(0.5,-1.0) is 0.49999997 (raw 0x3effffff). The code uses the roundf implementation in c99_functions. float roundf(float x) { float t; if (!isfinite (x)) return (x); if (x >= 0.0) { t = ceilf(x); if (t - x > 0.5) t -= 1.0; return (t); } else { t = ceilf(-x); if (t + x > 0.5) t -= 1.0; return (-t); } } The call to ceilf returns t = 1 (raw 0x3f800000). The result of t - x is 0.5 (raw 0x3f000000). So, roundf returns 1 and the test fails. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33595
next prev parent reply other threads:[~2008-12-28 20:26 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 [this message] 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 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=20081228202517.13112.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: linkBe 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).