🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1355

Re: Questions about NCEG

#1355
From: Patricia Shanahan
Date: Thu, 31 May 1990 19:54
44 lines
2726 bytes
In article <13028@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes:
>In article <1990May30.205436.11534@twinsun.com> eggert@twinsun.com (Paul Eggert) writes:
>>Doug Gwyn replied:
>>	These don't work.  -0.0 is NOT a "minus zero"; it's identical to 0.0.
>>Surely ANSI C doesn't require this; it is inconsistent with IEEE 754.
>
>I sometimes wonder why I waste my time responding.
>IEEE 754 does not apply to C source code!

The issue is even clearer for Fortran. According to the May 89 Fortran 8x
draft "Each numeric type includes a zero value, which is considered to be 
neither negative nor positive. The value of a signed zero is the same as 
the value of an unsigned zero." (there is a similar statement in the ANSI
Fortran 77 standard). For output conversion the draft specifies "a minus
if the value of the internal datum is negative, or an optional plus sign
otherwise...". According to the standard "+0.0" would be O.K., but "-0.0"
is prohibited.

In other words, there is no experiment you could perform in a standard
conforming program on a standard conforming Fortran implementation that 
would distinguish two different values of zero from each other.

Fortran users and implementers generally seem to take floating point types
far more seriously than typical C users and implementers. If distinguishing
-0.0 from 0.0 is such a good thing, why is it so expressly prohibited, not
just in early Fortran standards, but in the draft for the next Fortran 
standard?

I realize that C can (and does) have different rules from Fortran for
floating point arithmetic. However, there is about 30 years experience of
implementing numerical algorithms contributing to the Fortran standard.
Is it wise to ignore the choices that have been made for Fortran in this
area?

Note that there is nothing about this that prevents a standard conforming
Fortran implementation from being based on an IEEE floating point conforming
platform. It just requires a little care on the part of the language 
implementer to ensure that all zeros are equal to each other and are never
printed with minus signs.
--
	Patricia Shanahan
	ps@fps.com
        uucp : ucsd!celerity!ps
	phone: (619) 271-9940
Technical Details
Message-ID: <8846@celit.fps.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!network.ucsd.edu!celit!ps
References: <1990May29.193451.6533@twinsun.com> <13016@smoke.BRL.MIL> <1990May30.205436.11534@twinsun.com> <13028@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!network.ucsd.edu!celit!ps
From: ps@fps.com (Patricia Shanahan)
Newsgroups: comp.std.c
Subject: Re: Questions about NCEG
Message-ID: <8846@celit.fps.com>
Date: 31 May 90 19:54:40 GMT
References: <1990May29.193451.6533@twinsun.com> <13016@smoke.BRL.MIL> <1990May30.205436.11534@twinsun.com> <13028@smoke.BRL.MIL>
Sender: daemon@fps.com
Reply-To: ps@fps.com (Patricia Shanahan)
Organization: FPS Computing Inc., San Diego CA
Lines: 44