From -1283713584908416185
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10f5bc,6f6e97a6fdbbf44c
X-Google-Attributes: gid10f5bc,public
X-Google-Thread: 109fba,6f6e97a6fdbbf44c
X-Google-Attributes: gid109fba,public
X-Google-Thread: 102b75,6f6e97a6fdbbf44c
X-Google-Attributes: gid102b75,public
X-Google-Thread: 1149ec,6f6e97a6fdbbf44c
X-Google-Attributes: gid1149ec,public
X-Google-Thread: 1014db,6f6e97a6fdbbf44c
X-Google-Attributes: gid1014db,public
X-Google-Thread: f78e5,6f6e97a6fdbbf44c
X-Google-Attributes: gidf78e5,public
X-Google-Thread: 110292,6f6e97a6fdbbf44c
X-Google-Attributes: gid110292,public
From: dbinder@bnr.ca (David Binderman)
Subject: Re: And you thought that the Pentium bug was bad!  (Get a load of this!)
Date: 1995/06/19
Message-ID: <3s476i$led@bmdhh222.bnr.ca>#1/1
X-Deja-AN: 104726292
distribution: world
references: <3s2las$1br@hustle.rahul.net>
followup-to: comp.std.c,comp.std.c++,comp.lang.c,comp.lang.c++,comp.sys.intel,comp.arch,comp.software.testing
organization: Bell Northern Research
newsgroups: comp.std.c,comp.std.c++,comp.lang.c,comp.lang.c++,comp.sys.intel,comp.arch,comp.software.testing

Ronald F. Guilmette (rfg@rahul.net) wrote:
: Anyway, I'm looking forward to the reaction of the numerical computing
: community to the following short C program, and to the divergent results
: obtained when compiling this program with different _compilers_.

: -------------------------------------------------------------------------
: double d = 0.9;
:  
: int
: main ()
: {
:     double d = 0.8;
:     {
:         extern double d;
:  
:         printf ("%f\n", d);
:         return 0;
:     }
: }
: -------------------------------------------------------------------------

: This program *should* print 0.900000, and with most compilers, it does.
: But when compiled with one particular popular free C compiler, this
: program will print 0.800000.  

I got the following results:

vendor K&R C compiler            0.800000
vendor ISO C compiler            0.900000
a free ISO C compiler            0.800000

for extras, I added the required # include <stdio.h> and got the following
for C++

a free C++ compiler              0.900000
a commercial C++ compiler        0.900000

It looks like you found a bug in not only your ISO C compiler, but also
mine !

I'll leave the benefits of name overuse ...

: -- Ron Guilmette, Sunnyvale, CA ---------- RG Consulting -------------------
: ---- E-mail: rfg@segfault.us.com ----------- Purveyors of Compiler Test ----
: ---- finger: rfg@rahul.net ----------------- Suites and Bullet-Proof Shoes -

Nice one, Ron. Please keep trying.

Regards

David C Binderman MSc BSc       dbinder@bnr.co.uk         +44 1628 794 887
Object Oriented Design & Analysis with C++ since 1988
                      Code policeman, language lawyer and Purify advocate



