From -296087983128404027
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,d93488bb970aa444
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-06-04 13:04:01 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Scott Robert Ladd" <scott@coyotegulch.com>
Newsgroups: comp.std.c++
Subject: Re: How to test for NaNs and infinites?
Date: Mon,  4 Jun 2001 20:03:06 GMT
Organization: RoadRunner - TampaBay
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <nFMS6.396070$fs3.62950036@typhoon.tampabay.rr.com>
References: <3B176D2F.70C3E7F7@meteo.fr> <usrihtkqfjd9qfj2bgtbp6pj530asi567k@4ax.com>
X-Trace: mail2news.demon.co.uk 991684990 mail2news:14030 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)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Date: Mon, 04 Jun 2001 10:10:27 EDT
Lines: 39
Xref: archiver1.google.com comp.std.c++:5664

"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++.

> Other standards provide definitions and APIs for floating-point, and
> an implementation could choose to follow one or more of them.

Perhaps extension of the is_iec559 would be reasonable? On the other hand,
this is one area where I don't see why C99 and C++0X cannot be compatible.

--
Scott Robert Ladd
Master of Complexity
Destroyer of Order and Chaos
http://www.coyotegulch.com


---
[ 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                ]



