Article View: comp.std.c
Article #1362Re: Questions about NCEG
From: Richard A. O'Keefe
Date: Thu, 31 May 1990 13:10
Date: Thu, 31 May 1990 13:10
38 lines
2333 bytes
2333 bytes
In article <1990May29.193451.6533@twinsun.com> eggert@twinsun.com (Paul Eggert) writes:
>|(3) There are special numbers (+ and - infinity, -0, NaNs, Vax reserved
>| operands, &c) which have no standard syntax.
[actually, I think I wrote that bit]
In article <5491@ibmpa.UUCP>, jsalter@slo.uucp (James Salter) writes:
> Nitpick: -0 is an integer and doesn't exist. -0.0 is a floating-point value
> and does exist.
Counter-nitpick: the text of ANSI/IEEE Std 754-1985 consistently says -0,
not -0.0
> But IEEE 754 (Sec. 5.7) says that when comparing the two, (-0.0 == +0.0)
> so that can't be used for comparison. The way I test this is to strip
> off the sign bit and test that.
Would it not be better to use copysign()? (754 Appendix (1)).
By the way, someone said that -0.0 is 0.0 in C. The Appendix *is not
binding*, but it does say "-X is X copied with its sign reversed, not 0-X;
the distinction is germane when X is +/- 0 or NaN."
> There aren't a lot of people who actually use the data that can be embedded
> in NaNs, so it's not very worrysome.
IEEE 754 says that "at least one signalling Nan" and "at least one quiet
Nan" "shall be provided". The encoding for single and double is spelled
out and has room for more, but there is nothing to say that single
extended or double extended has more than 2 NaNs. With reference to
hex float, the encoding of single and double extended isn't specified
either, so there is _no_ method of expressing a long double that is
covered by IEEE 754.
Of course, C also has to cater for people using /370s, Crays,
non-IEEE-conformant chips like 8087s (ask about the details in
comp.arch, I've forgotten), VAXen, PR1MEs.
--
"A 7th class of programs, correct in every way, is believed to exist by a
few computer scientists. However, no example could be found to include here."
Technical Details
Message-ID:
<3121@goanna.cs.rmit.oz.au>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!munnari.oz.au!ditmela!yarra!monu6!minyos!goanna!okReferences:
<15519@bfmny0.UU.NET> <73.UUL1.3#5109@pantor.UUCP> <5491@ibmpa.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!munnari.oz.au!ditmela!yarra!monu6!minyos!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.std.c Subject: Re: Questions about NCEG Message-ID: <3121@goanna.cs.rmit.oz.au> Date: 31 May 90 13:10:44 GMT References: <15519@bfmny0.UU.NET> <73.UUL1.3#5109@pantor.UUCP> <5491@ibmpa.UUCP> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 38