public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Scott Robert Ladd <scott.ladd@coyotegulch.com>
To: Andreas Schwab <schwab@suse.de>
Cc: gcc@gcc.gnu.org
Subject: Re: What is wrong with Bugzilla? [Was: Re: GCC and Floating-Point]
Date: Tue, 31 May 2005 16:53:00 -0000	[thread overview]
Message-ID: <429C751C.2080108@coyotegulch.com> (raw)
In-Reply-To: <jeacmbtrnq.fsf@sykes.suse.de>

Andreas Schwab wrote:
>> No, this is not portable,
> 
> Sure they are, since they are required since C89.
> 
> You can use <float.h> to find that out.  That's what portability is
> about.

"Portability" means different things to different people. There's a
difference between source code portability and "result" portability.

If you follow Standard C, you are guaranteed source code portability, in
the program compiles and produce the "same" results with any Standard C
compiler.

When we start talking about floating-point code, however, we enter the
realm of "result" portability, in that different platforms (or different
compiler swicthes) return slightly different numbers from the same
source code.

An example of this is the use of long double, the implementation of
which differs from platform to platform. On Intel-inspired processors, a
long double is 80 bits long with a 64-bit mantissa, corresponding to the
x87 registers. On other systems, long double may be the same as double,
having 64 bits and a 53-bit mantissa. Calculations with 80-bit long
doubles will differ from the same computations performed using 64-bit
long doubles.

C does not enforce identical results on all platforms; Java does (or at
least tries to).

It's an easy problem to get tripped by, as I recently experienced on
this forum.

..Scott

  reply	other threads:[~2005-05-31 14:32 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-28 17:10 Uros Bizjak
2005-05-28 23:02 ` Scott Robert Ladd
2005-05-28 23:28   ` Daniel Berlin
2005-05-28 23:29   ` William Beebe
2005-05-29  4:47     ` Scott Robert Ladd
2005-05-29 18:32   ` Kai Henningsen
2005-05-29 18:52     ` William Beebe
2005-05-29 19:24       ` What is wrong with Bugzilla? Russ Allbery
2005-05-30 16:32         ` William Beebe
2005-05-30 19:22           ` Russ Allbery
2005-05-30 15:35       ` What is wrong with Bugzilla? [Was: Re: GCC and Floating-Point] Kai Henningsen
2005-05-31  3:50         ` chris jefferson
2005-05-31  5:56           ` Gary Funck
2005-05-31  6:04           ` Paul Brook
2005-05-30 15:39       ` Daniel Berlin
2005-05-29  1:30 ` Vincent Lefevre
2005-05-29 15:57   ` Giovanni Bajo
2005-05-29 18:05     ` Michael Veksler
2005-05-30 15:34       ` Vincent Lefevre
2005-05-30 15:48       ` Daniel Berlin
2005-05-30 15:31         ` Vincent Lefevre
     [not found]       ` <26669933.1117479096256.JavaMail.root@dtm1eusosrv72.dtm.ops.eu.uu.net>
2005-05-30 21:17         ` Toon Moene
2005-05-31 11:24           ` Robert Dewar
2005-06-06 21:47             ` Laurent GUERBY
2005-06-06 23:23               ` Robert Dewar
2005-06-09  7:44                 ` Vincent Lefevre
2005-05-31 12:51           ` Vincent Lefevre
2005-05-31 13:17             ` Andreas Schwab
2005-05-31 13:44               ` Vincent Lefevre
2005-05-31 14:32                 ` Andreas Schwab
2005-05-31 15:10                   ` Vincent Lefevre
2005-05-31 15:58                     ` Andreas Schwab
2005-05-31 16:53                       ` Scott Robert Ladd [this message]
2005-05-31 17:03                         ` Andreas Schwab
2005-05-31 18:40                           ` Vincent Lefevre
2005-05-31 19:28                             ` Jakub Jelinek
2005-05-31 23:30                               ` Vincent Lefevre
2005-05-31 18:35                         ` Vincent Lefevre
2005-05-31 17:44                       ` Vincent Lefevre
2005-05-31 20:11                         ` Andreas Schwab
2005-05-31 23:53                           ` Vincent Lefevre
     [not found]                             ` <jefyw3jguf.fsf@sykes.suse.de>
     [not found]                               ` <20050531224258.GJ3541@ay.vinc17.org>
     [not found]                                 ` <jemzqb2eb2.fsf@sykes.suse.de>
2005-06-01  0:23                                   ` Vincent Lefevre
2005-06-01  8:42                                     ` Andreas Schwab
2005-05-31 17:21                     ` Mike Stump
2005-05-31 17:44                       ` Dave Korn
2005-06-01  1:57                         ` Marcin Dalecki
2005-05-31 19:27                       ` Vincent Lefevre
2005-05-31 19:58                         ` Mike Stump
2005-05-31 23:40                           ` Vincent Lefevre
2005-06-01  5:59                             ` Alan Modra
2005-06-01  7:21                               ` Vincent Lefevre
2005-06-01 17:32                                 ` Mike Stump
2005-06-01 18:01                                   ` Daniel Berlin
2005-06-01 18:33                                     ` Mike Stump
2005-05-29 20:13     ` Joseph S. Myers
2005-05-29 20:18       ` Haren Visavadia
2005-05-30 15:40   ` Daniel Berlin
2005-05-30 15:31     ` Vincent Lefevre
2005-05-30 20:12     ` Haren Visavadia
2005-05-30 20:13       ` Robert Dewar
2005-05-30 20:34         ` Haren Visavadia
2005-05-30 20:46           ` Robert Dewar
2005-05-30 21:10             ` Haren Visavadia
2005-05-31  9:11               ` Robert Dewar
2005-05-31 12:33             ` Vincent Lefevre
2005-05-31 12:48               ` Andrew Haley
2005-05-31 13:35                 ` Vincent Lefevre
2005-05-31 14:08                 ` Vincent Lefevre
2005-06-22 19:44     ` What is wrong with Bugzilla? Gerald Pfeifer
2005-05-29  7:33 ` What is wrong with Bugzilla? [Was: Re: GCC and Floating-Point] Ross Smith
2005-05-29  7:51   ` Joe Buck
2005-05-29  9:56     ` R Hill
2005-05-30 17:03       ` What is wrong with Bugzilla? Zack Weinberg
2005-05-30 19:39         ` Gary Funck
2005-05-30 15:48   ` What is wrong with Bugzilla? [Was: Re: GCC and Floating-Point] Daniel Berlin
2005-05-31  7:40     ` R Hill
2005-05-31 12:04       ` What is wrong with Bugzilla? Russ Allbery
2005-05-31 12:08         ` R Hill
2005-05-31 17:14         ` Dave Korn
2005-05-31 17:14           ` Daniel Berlin
2005-05-31 17:43             ` Dave Korn
2005-05-31 19:18               ` Daniel Berlin
2005-05-31 19:43                 ` Dave Korn
2005-05-31 17:22   ` What is wrong with Bugzilla? [Was: Re: GCC and Floating-Point] Hugh Sasse
2005-05-29 12:54 ` Haren Visavadia
2005-05-29 15:19   ` Michael Veksler
2005-05-29 15:38     ` Giovanni Bajo
2005-05-29 18:16       ` Michael Veksler
2005-05-30 16:07       ` Daniel Berlin
2005-05-30 15:36         ` Michael Veksler
2005-05-30 15:28           ` Daniel Berlin
2005-05-30 15:28           ` Daniel Berlin
2005-05-29 17:23     ` Haren Visavadia
2005-05-30 15:25     ` Joe Buck
2005-05-30 15:31     ` Vincent Lefevre
2005-05-30 15:43     ` Daniel Berlin

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=429C751C.2080108@coyotegulch.com \
    --to=scott.ladd@coyotegulch.com \
    --cc=gcc@gcc.gnu.org \
    --cc=schwab@suse.de \
    /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).