public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: What is -3.I (as opposed to 0-3.I) supposed evaluate to?
Date: Tue, 09 Jun 2009 15:26:00 -0000	[thread overview]
Message-ID: <AC7E0540BCE34774B8CABCBCAF5930C0@glap> (raw)
In-Reply-To: <Pine.LNX.4.64.0906091121160.6461@digraph.polyomino.org.uk>

From: "Joseph S. Myers" <joseph@codesourcery.com>

> On Mon, 8 Jun 2009, Kaveh R. Ghazi wrote:
>
>> Perhaps the only safe way to create the value, even in the presence of
>> rounding mode changes, is to use conj(3.I) ?
>
> Setting the __real__ and __imag__ parts of a temporary variable should
> always be reliable for making a complex number out of arbitrary real and
> imaginary parts.

Well yes, but I meant for compile-time expressions that are exposed to fold 
even at -O0.  (Recall that I'm writing testcases for the MPC stuff.)  I'm 
not 100% confident that the temporary variable will always fold and it's too 
verbose when repeatedly used in a testcase.  With conj, the builtin will 
always fold 3.I and won't do anything unexpected with rounding modes.

I was just wondering why -3.I was evaluating differently than 0-3.I and 
whether it was a bug.  Your explanation was very useful.

        Thanks,
        --Kaveh

  reply	other threads:[~2009-06-09 15:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 20:12 Kaveh R. GHAZI
2009-06-08 20:33 ` Joseph S. Myers
2009-06-09  2:08   ` Kaveh R. Ghazi
2009-06-09 11:22     ` Joseph S. Myers
2009-06-09 15:26       ` Kaveh R. Ghazi [this message]
2009-06-09 15:33         ` Richard Guenther

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=AC7E0540BCE34774B8CABCBCAF5930C0@glap \
    --to=ghazi@caip.rutgers.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /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).