public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "post+gcc at ralfj dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/112449] Arithmetic operations can produce signaling NaNs
Date: Thu, 09 Nov 2023 06:46:56 +0000	[thread overview]
Message-ID: <bug-112449-4-mynw4j31ak@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112449-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112449

--- Comment #6 from post+gcc at ralfj dot de ---
Hm, OTOH the C standard says

> The expressions 1×x, x/1, and x are equivalent (on IEC 60559 machines, among
others).

So, it seems like when they say "The + ,- , * , and / operators provide the IEC
60559 add, subtract, multiply, and divide operations.", they don't quite mean
that.

This seems internally inconsistent in the C standard, since C also permits
`pow(1, sNaN)` to behave different from `pow(1, qNaN)` -- and in fact they do
behave different in GNU's libm. So on the one hand `pow(1, x * y)` must always
be `1` but on the other hand it can return a NaN when `x` is an sNaN and `y` is
`1`?

  parent reply	other threads:[~2023-11-09  6:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 21:03 [Bug c/112449] New: " post+gcc at ralfj dot de
2023-11-08 21:11 ` [Bug c/112449] " pinskia at gcc dot gnu.org
2023-11-08 21:18 ` pinskia at gcc dot gnu.org
2023-11-08 21:40 ` pinskia at gcc dot gnu.org
2023-11-08 21:43 ` pinskia at gcc dot gnu.org
2023-11-09  6:40 ` post+gcc at ralfj dot de
2023-11-09  6:46 ` post+gcc at ralfj dot de [this message]
2023-11-09  6:56 ` post+gcc at ralfj dot de
2023-11-09  7:57 ` rguenth at gcc dot gnu.org
2023-11-09 17:53 ` joseph at codesourcery dot com
2023-11-09 20:33 ` post+gcc at ralfj dot de
2023-11-10  8:15 ` rguenth at gcc dot gnu.org
2023-11-10 10:27 ` post+gcc at ralfj dot de
2023-11-13 22:46 ` joseph at codesourcery 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=bug-112449-4-mynw4j31ak@http.gcc.gnu.org/bugzilla/ \
    --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).