🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1327

Re: Questions about NCEG

#1327
From: Doug Gwyn
Date: Wed, 30 May 1990 11:07
30 lines
2240 bytes
In article <1990May29.193451.6533@twinsun.com> eggert@twinsun.com (Paul Eggert) writes:
>|(1) If you stick to the letter of the IEEE 754 and IEEE 854 standards,
>|    conversion of numeric literals from decimal to binary (or possibly,
>|    in the case of 854, to internal decimal) is a *run* *time* operation,
>No C compiler that I know of does this.  Does this mean that no C compiler can
>claim conformance to both IEEE 754 and ANSI C?  I fear that if we ask either
>standards committee for a ruling, they'll refer us to the other committee.

Fear what you will.  X3J11 certainly did consider this and other floating-
point issues.  The C standard supports use of IEEE floating-point.  However,
it doesn't require that access be granted to all features of it, just the
consistent subset chosen for the C implementation.  Use of extensions that
access such features as selection of rounding mode render a program not
strictly conforming, so the implementation is at liberty to give the
expected meaning to them.

>There are ways to say the IEEE numbers in ANSI C + IEEE 754:
>	#define minus_0 (-0.0)
>	#define infinity (1e300*1e300)
>	#define NaN1 (infinity-infinity)
>	#define minus_infinity (-infinity)
>	#define minus_NaN1 (-NaN1)

These don't work.  -0.0 is NOT a "minus zero"; it's identical to 0.0.
Assuming that 1.0e+300*1.0e+300 is not representable as a (floating-
pint) number, the behavior is explicitly undefined, and the implementation
is not obliged to produce a representation of "infinity" for it.  Assuming
you had defined "infinity" properly, the remaining expressions lie outside
the scope of the C standard, and nothing obliges an implementation to do
what you appear to wish be done about them.
Technical Details
Message-ID: <13016@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
References: <73.UUL1.3#5109@pantor.UUCP> <3094@goanna.cs.rmit.oz.au> <1990May29.193451.6533@twinsun.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Questions about NCEG
Message-ID: <13016@smoke.BRL.MIL>
Date: 30 May 90 11:07:10 GMT
References: <73.UUL1.3#5109@pantor.UUCP> <3094@goanna.cs.rmit.oz.au> <1990May29.193451.6533@twinsun.com>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 30