Article View: comp.std.c
Article #1347Re: Questions about NCEG
From: Paul Eggert
Date: Thu, 31 May 1990 22:34
Date: Thu, 31 May 1990 22:34
42 lines
2794 bytes
2794 bytes
Doug Gwyn writes: ... the IEEE 754 "user" can be taken as the C implementation. There is no requirement that the "user" actually exploit all the features that IEEE 754 requires be made available to the "user". To conform to IEEE 754, an ANSI C implementation can't merely use IEEE 754 internally. It must make IEEE 754 available to its users, namely to the programs that it accepts. If a company advertised that its C implementation conformed to both ANSI C and IEEE 754, and its customers complained about IEEE 754 features that were missing, could it get away with telling them that their programs weren't the real ``users'' of IEEE 754? [IEEE 754] does not require that writing "-0.0" in C source code be a way of producing a "minus zero". True, but only because neither standard talks about each other, so an implementation that conforms to both ANSI C and IEEE 754 can combine them perversely. For example, a perverse implementer could say ``to use IEEE 754, one must use the types like _ieee_754_double_format, and invoke functions like _ieee_754_double_negate(x)''. But in a normal implementation, one would expect the ANSI C types float and double to stand for IEEE 754 single format and double format, and the ANSI C unary floating `-' operator to stand for the IEEE 754 `-x' function. In such an implementation, -0.0 must evaluate to minus zero. Mathematically it is nonsense to say -0 is not identical to 0. I also dislike some of IEEE 754's provisions. But that's not the issue here. Granted, no standard specifies the relationship between IEEE 754 and ANSI C, and what I think is ``perverse'' is only my opinion; but surely most users would agree with the ``normal'' implementation described above. However, if we don't all agree on this question, shouldn't it be addressed by NCEG? While we're on the subject, NCEG should provide for a way for a program to print a number so that it can be read back. ANSI C's "C" locale requires that an IEEE 754 implementation's scanf() cannot read some numbers that its printf() should be able to output, namely infinities and NaNs. This is unfortunate: it should be easy for a program to scan numbers that it prints. How can I forward comments like this to the NCEG committee?
Technical Details
Message-ID:
<1990May31.223436.23066@twinsun.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!usc!orion.oac.uci.edu!uci-ics!ucla-cs!twinsun!eggertReferences:
<13016@smoke.BRL.MIL> <1990May30.205436.11534@twinsun.com> <13027@smoke.BRL.MIL> <13028@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!usc!orion.oac.uci.edu!uci-ics!ucla-cs!twinsun!eggert From: eggert@twinsun.com (Paul Eggert) Newsgroups: comp.std.c Subject: Re: Questions about NCEG Message-ID: <1990May31.223436.23066@twinsun.com> Date: 31 May 90 22:34:36 GMT References: <13016@smoke.BRL.MIL> <1990May30.205436.11534@twinsun.com> <13027@smoke.BRL.MIL> <13028@smoke.BRL.MIL> Sender: usenet@twinsun.com Organization: Twin Sun, Inc Lines: 42