From 3962811745560659220
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,d93488bb970aa444
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-06-11 05:57:01 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: kanze@gabi-soft.de (James Kanze)
Newsgroups: comp.std.c++
Subject: Re: How to test for NaNs and infinites?
Date: Mon, 11 Jun 2001 12:56:06 GMT
Organization: http://groups.google.com/
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <d6651fb6.0106110453.7ce6ef13@posting.google.com>
References: <3B176D2F.70C3E7F7@meteo.fr> <usrihtkqfjd9qfj2bgtbp6pj530asi567k@4ax.com> <nFMS6.396070$fs3.62950036@typhoon.tampabay.rr.com>
X-Trace: mail2news.demon.co.uk 992264183 mail2news:28970 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
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)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Date: 11 Jun 2001 12:53:55 GMT
Lines: 47
Xref: archiver1.google.com comp.std.c++:5923

"Scott Robert Ladd" <scott@coyotegulch.com> wrote in message news:<nFMS6.396070$fs3.62950036@typhoon.tampabay.rr.com>...
> "Stephen Clamage" <stephen.clamage@sun.com> wrote:

> > There are no provisions in the C++ standard. The standard makes
> > almost no requirements on floating-point types. Implementations
> > are not required to support NaN or infinity. If support is
> > provided, it can take any form that the implementation chooses.

> Is this a good thing? Especially in light of the numeric support now
> provided by C99?

> While I understand the portability reasons for leaving NaNs and
> infinities unspecified, I think the scheme implemented by C99
> (sec. 7.12) is quite reasonable, if not entirely "C++"ish in nature.

> I note that Zortech C++ supported the "C Numeric Extensions" long
> ago (I wrote the numeric programming docs for Zortech/Symantec, in
> fact, which is darned close to what C99 implemented).

> Perhaps someone can explain why the C99 numerical conventions cannot
> be safely implemented in C++.

They probably can.

The current C++ standard could not reference C99, since it was
published in 1998.  I'm just guessing, but I could imagine that part
of the reason the C++ committee didn't do more with regards to IEEE
floating point is because they knew that the C committee was working
on it, and felt that to be the more appropriate place.  (Presumably,
the C which the next version of the C++ will refer to will be C99.)

In the meantime, most C++ compilers are strongly coupled to C
compilers; I would be very surprised if any of these didn't implement
the new C numeric stuff in C++, as an extension.

--
James Kanze                               mailto:kanze@gabi-soft.de
Conseils en informatique orient�e objet/
                   Beratung in objektorientierter Datenverarbeitung
Ziegelh�ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627

---
[ 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.research.att.com/~austern/csc/faq.html                ]



