public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/30694] minval/maxval with +/-Inf
Date: Wed, 17 Oct 2007 22:32:00 -0000	[thread overview]
Message-ID: <20071017223215.20130.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30694-10391@http.gcc.gnu.org/bugzilla/>



------- Comment #21 from fxcoudert at gcc dot gnu dot org  2007-10-17 22:32 -------
I've been thinking about MINVAL((/NaN,NaN/)), ie minval of an array containing
only NaNs, over and over again, and it's a tough choice. Here's what compilers
currently output for MINVAL and MAXVAL:

Intel: Inf, -Inf
Sun: -NaN, -NaN (yes, that's a negative NaN; don't ask)
g95: Huge, -Huge
gfortran: Huge, -Huge
portland: NaN, -Huge
MIPSpro: Inf, NaN
IBM: Huge, -Huge

So: we can take portland and MIPSpro out, they lack consistency; Intel goes for
infinities, and I don't see how they can justify this in any way, so let's take
them out also. The only two options worth considering are NaN (as Sun does) and
Huge (as Intel and g95 do). Both have pros and cons. The main pro for NaN is
that it ensures that MAXVAL((/x,x/)) is always equal to MAX(x,x), even when x
is a NaN. The main pro for Huge is that it is more consistent with the way NaN
are ignored: for all other purposes, NaNs in the array are handled as if the
mask for that element was .false., so why single out the "only NaNs" case?

Since different compilers already give different answers for this problem, I
guess we can pick the solution we're most comfortable with. Unless people feel
strongly against it, I'd like to go with Huge, because 1. I'm more convinced by
arguments in favour of it, and 2. it's probably easier/faster/more efficient to
implement, because it doesn't need yet another special case.

Opinions welcome. (What a long rant.)


-- 


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


  parent reply	other threads:[~2007-10-17 22:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03 16:17 [Bug fortran/30694] New: " tkoenig at gcc dot gnu dot org
2007-02-03 16:41 ` [Bug fortran/30694] " burnus at gcc dot gnu dot org
2007-02-03 19:28 ` tkoenig at gcc dot gnu dot org
2007-02-03 20:28 ` pinskia at gcc dot gnu dot org
2007-02-04  0:19 ` burnus at gcc dot gnu dot org
2007-02-05 19:41 ` burnus at gcc dot gnu dot org
2007-02-06 12:12 ` [Bug libfortran/30694] " fxcoudert at gcc dot gnu dot org
2007-02-06 12:30 ` burnus at gcc dot gnu dot org
2007-02-07 17:55 ` tkoenig at gcc dot gnu dot org
2007-02-14 20:21 ` fxcoudert at gcc dot gnu dot org
2007-03-25  9:49 ` fxcoudert at gcc dot gnu dot org
2007-03-25 20:05 ` tkoenig at gcc dot gnu dot org
2007-04-10 19:58 ` tkoenig at gcc dot gnu dot org
2007-04-15 21:12 ` tkoenig at gcc dot gnu dot org
2007-04-18 21:59 ` fxcoudert at gcc dot gnu dot org
2007-04-19 20:03 ` tkoenig at gcc dot gnu dot org
2007-05-14 21:37 ` mmitchel at gcc dot gnu dot org
2007-05-17 13:40 ` tkoenig at gcc dot gnu dot org
2007-06-15 18:56 ` tkoenig at gcc dot gnu dot org
2007-06-15 18:56 ` tkoenig at gcc dot gnu dot org
2007-06-21 18:12 ` pault at gcc dot gnu dot org
2007-07-20  3:49 ` mmitchel at gcc dot gnu dot org
2007-08-08 15:08 ` fxcoudert at gcc dot gnu dot org
2007-10-09 19:28 ` mmitchel at gcc dot gnu dot org
2007-10-17 22:32 ` fxcoudert at gcc dot gnu dot org [this message]
2007-10-17 23:49 ` jvdelisle at gcc dot gnu dot org
2007-10-17 23:58 ` kargl at gcc dot gnu dot org
2007-10-18  0:18 ` jvdelisle at gcc dot gnu dot org
2007-10-18  7:38 ` fxcoudert at gcc dot gnu dot org
2007-10-18 18:23 ` burnus at gcc dot gnu dot org
2007-12-08 18:07 ` fxcoudert at gcc dot gnu dot org
2008-02-01 16:59 ` jsm28 at gcc dot gnu dot org
2008-02-01 17:23 ` fxcoudert at gcc dot gnu dot org
2009-07-15  9:41 ` burnus at gcc dot gnu dot org
2009-07-24  8:21 ` burnus at gcc dot gnu dot org
2009-12-05 21:53 ` tkoenig 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=20071017223215.20130.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).