public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <morin-mikael@orange.fr>
To: FX <fxcoudert@gmail.com>
Cc: Fortran <fortran@gcc.gnu.org>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fortran 2018 rounding modes changes
Date: Mon, 19 Sep 2022 19:09:46 +0200	[thread overview]
Message-ID: <c6cd7bee-01c1-afee-6520-ae67189f0487@orange.fr> (raw)
In-Reply-To: <52A7FAB8-735E-42D8-97A6-7E4C4F108C5E@gmail.com>

Le 19/09/2022 à 18:17, FX a écrit :
> Hi,
> 
>>> 2. Add the optional RADIX argument to IEEE_SET_ROUNDING_MODE and IEEE_GET_ROUNDING_MODE. It is unused for now, because we do not support floating-point radices other than 2.
>> If we accept the argument, we have to support it somehow.
>> So for IEEE_GET_ROUNDING_MODE (*, 10), we should return IEEE_OTHER, shouldn't we?
> 
> I think I disagree. We do not support any real kind with radix 10, so calling IEEE_GET_ROUNDING_MODE with RADIX=10 is invalid. Or, in another interpretation, the rounding mode is whatever-you-want-to-call it, since you cannot perform arithmetic in that radix anyway.
> 
Hmm, not really convinced, but that's a possible interpretation, I guess.
> 
>> There is no problem for IEEE_SET_ROUNDING_MODE (*, 10) as there is no way this to be a valid call if radix 10 is not supported, but changing a compile time error to a runtime unexpected behavior seems like a step backwards.
> 
> What do you mean by that? The behavior is not unexpected, the value returned by IEEE_GET_ROUNDING_MODE for RADIX=10 is irrelevant and cannot be used for anything useful.
> 

My sentence was about IEEE_*S*ET_ROUNDING_MODE actually.
My point that we previously reported an error (at compile time) to a 
user that would try to pass a radix 10 while we now silently do... 
something else that was requested (i.e. set the radix 2 rounding mode).

I think it's worth at least documenting that only radix 2 is supported.

  reply	other threads:[~2022-09-19 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31 18:29 FX
2022-08-31 20:42 ` Bernhard Reutner-Fischer
2022-08-31 21:23   ` FX
2022-09-10 10:21 ` FX
2022-09-19 12:26   ` FX
2022-09-19 15:35 ` Mikael Morin
2022-09-19 16:17   ` FX
2022-09-19 17:09     ` Mikael Morin [this message]
2022-09-19 17:29       ` FX
2022-09-21  9:15         ` FX

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=c6cd7bee-01c1-afee-6520-ae67189f0487@orange.fr \
    --to=morin-mikael@orange.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=fxcoudert@gmail.com \
    --cc=gcc-patches@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).