From 1279730555550807704
X-Google-Thread: f78e5,eb811809d4f61b12
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 19 May 2006 06:50:07 -0500
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@ucar.edu
From: "kanze" <kanze@gabi-soft.fr>
Newsgroups: comp.std.c++
Subject: Re: Using extended precision in floating point
Organization: http://groups.google.com
Message-ID: <1148033537.225653.254200@j55g2000cwa.googlegroups.com>
References: <1147882581.972497.100340@u72g2000cwu.googlegroups.com>
   <pxbwtcjbv8l.fsf@news.bourguet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: j55g2000cwa.googlegroups.com; posting-host=62.160.54.162;
   posting-account=qsfl8gwAAABZGaLp2a7FeTfDkJamzWYW
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.cs.mu.OZ.AU id k4JAHTtF002953
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Date: Fri, 19 May 2006 06:40:47 CST
Lines: 67
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-u9IjqCC+vlw87WgeSYNlfgD0DVhjQAWD39UCmpYVFCJ9UqdRFatqYRQXkOOE67V5cCiXye5CYyHnhv8!ZopYgFOMCBRPFZHPEirHHX2YTKKewH29pTRwRFItm72xTQmMt3NjkQCkwPSu2b+kvPUD6pqsIHvh!8HsqpNYCdJbxQsFIK3eTI+E5JAIXkZSHgOlg5qkeVbk=
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news2.google.com comp.std.c++:2067

Jean-Marc Bourguet wrote:
> "kanze" <kanze@gabi-soft.fr> writes:

> > I'd always been pretty sure of this, but on analysing some
> > code which wasn't giving the expected results (they were too
> > accurate for the algorithm being used !), I found that g++
> > (on a PC) used extended precision through out the loop, at
> > least when optimization was requested.  Is this an error in
> > g++, or have I misunderstood something?

> > (For those who are familiar with Intel assembler, the body of
> > the loop is simply:

> > .L9:
> > 	fadd	DWORD PTR [%ecx+%eax*4]
> > 	inc	%eax
> > 	cmp	%eax, %edx
> > 	jb	.L9
> >
> > .)

> I think this is a bug is gcc.  But see:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

> There are something like 70 duplicates.

> One comment is in the bug log is:

> Steven> ...to end this pointless discussion.
> Steven>
> Steven> Some people call this a bug in the x87 series.  Other call it a bug in
> Steven> gcc.  See these mails at least for the reason why this could be considered
> Steven> a bug in gcc:
> Steven> http://gcc.gnu.org/ml/gcc/2003-08/msg01195.html
> Steven> http://gcc.gnu.org/ml/gcc/2003-08/msg01234.html
> Steven> http://gcc.gnu.org/ml/gcc/2003-08/msg01257.html
> Steven>
> Steven> Regardless of where one wishes to put the blame, this problem will _not_ be
> Steven> fixed.  Period.

>From what I understand, adding the option -ffloat-store should
cause conformant behavior.  Maybe they should mention this in
the documentation for options like -std=c++98.  (IMHO, the
current behavior of g++ is probably preferable in most cases.
My question only concerned standards conformance.)

I also think that the standard isn't as clear as it could be.  I
think that the intent is that even when extended precision is
used in sub-expressions, the programmer can force normal
precision by means of a cast or an assignment.  The standard can
certainly be interpreted this way, but I'm not sure that other
interpretations are not possible.

--
James Kanze                                           GABI Software
Conseils en informatique orient�e objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place S�mard, 78210 St.-Cyr-l'�cole, France, +33 (0)1 30 23 00 34


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



