public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Love-Jensen <eljay@adobe.com>
To: Cristea Bogdan <cristeab@gmail.com>, MSX to GCC <gcc-help@gcc.gnu.org>
Subject: Re: Floating point results change with different compilation  options
Date: Tue, 23 Oct 2007 12:01:00 -0000	[thread overview]
Message-ID: <C3434817.2638B%eljay@adobe.com> (raw)
In-Reply-To: <e7b7bbdc0710230104l55dcb060vef9233bc07922f12@mail.gmail.com>

Hi Cristea,

> Is this a bug of the compiler...?

No.  Certain optimizations can exacerbate code that poorly accommodates
float peculiarities.

> ...or the floating point representation differs from one compiler version to
the other?

No, not the representation.  Probably the calculation.

The problem is one-or-both of:
+ not all hardware is compliant with IEEE 754 calculations
+ not all code is written carefully to accommodate float peculiarities

Please read the article What Every Computer Scientist Should Know About
Floating-Point Arithmetic, by David Goldberg (1991).

http://docs.sun.com/source/806-3568/ncg_goldberg.html

HTH,
--Eljay

  reply	other threads:[~2007-10-23 11:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23  8:42 Cristea Bogdan
2007-10-23 12:01 ` John Love-Jensen [this message]
2007-10-23 17:36 ` burlen

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=C3434817.2638B%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=cristeab@gmail.com \
    --cc=gcc-help@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).