Article View: comp.lang.fortran
Article #6525Re: Precision of floating point multiply
From: Glen Herrmannsfeldt
Date: Mon, 29 Sep 2003 20:45
Date: Mon, 29 Sep 2003 20:45
42 lines
3322 bytes
3322 bytes
"Nick Maclaren" <nmm1@cus.cam.ac.uk> wrote in message news:bla4k2$nas$1@pegasus.csx.cam.ac.uk... > In article <Rh0eb.632709$Ho3.121617@sccrnsc03>, > Glen Herrmannsfeldt <gah@ugcs.caltech.edu> wrote: > > > >Well, you would get SDR 2,2 and LE 2,A in that case. The compiler does have > >to keep track of which registers have single and which have double values. > >Leaving low bits from previous calculations in would seem a bad idea. > >Though according to other posts it may be legal in Fortran. > > It certainly is legal, provided they are from an appropriate calculation, > but that is not what is going on here. > > The specification of IBM floating-point register operations is precisely > that the unused low-order bits are ignored. Those bits are therefore > NOT being left in the value; they are being left OUTSIDE the value. > That is why it is quite safe for single precision multiply to create > them and to leave them where they are. > > Similarly, conversion from single to double precision has to clear those > bits, whether the operand being converted has been created by multiply > or anything else. What I was saying is that if conversion from single to double did not clear those bits you would get whatever was left there, possibly from an unrelated calculation. I believe that would be a bad idea, but some posts by others seem to indicate that it would be legal Fortran. Someone else posted: |Item (6) listed in Section 1.4 of the Fortran standard explicitly |states that the standard does not specify | | (6) The physical properties of the representation of quantities and | the method of rounding, approximating, or computing numeric | values on a particular processor. The belief is that this statement could include leaving garbage bits in for low bits. -- glen
Technical Details
Message-ID:
<FR0eb.637973$uu5.101567@sccrnsc04>Path:
arc1-ca.pugleaf.net!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc04.POSTED!not-for-mailReferences:
<dG4db.598668$uu5.97984@sccrnsc04> <xrXdb.631209$Ho3.121609@sccrnsc03> <bl9ild$abv$1@pegasus.csx.cam.ac.uk> <Rh0eb.632709$Ho3.121617@sccrnsc03> <bla4k2$nas$1@pegasus.csx.cam.ac.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fd4af,7830916812112af0 X-Google-Attributes: gidfd4af,public X-Google-Thread: 102b75,7830916812112af0 X-Google-Attributes: gid102b75,public X-Google-Thread: fd705,7830916812112af0 X-Google-Attributes: gidfd705,public X-Google-Thread: 1094ba,7830916812112af0 X-Google-Attributes: gid1094ba,public X-Google-ArrivalTime: 2003-09-29 13:45:26 PST Path: arc1-ca.pugleaf.net!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc04.POSTED!not-for-mail From: "Glen Herrmannsfeldt" <gah@ugcs.caltech.edu> Newsgroups: comp.lang.fortran,comp.arch,bit.listserv.ibm-main,alt.folklore.computers References: <dG4db.598668$uu5.97984@sccrnsc04> <xrXdb.631209$Ho3.121609@sccrnsc03> <bl9ild$abv$1@pegasus.csx.cam.ac.uk> <Rh0eb.632709$Ho3.121617@sccrnsc03> <bla4k2$nas$1@pegasus.csx.cam.ac.uk> Subject: Re: Precision of floating point multiply Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: <FR0eb.637973$uu5.101567@sccrnsc04> NNTP-Posting-Host: 12.207.204.17 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc04 1064868325 12.207.204.17 (Mon, 29 Sep 2003 20:45:25 GMT) NNTP-Posting-Date: Mon, 29 Sep 2003 20:45:25 GMT Organization: Comcast Online Date: Mon, 29 Sep 2003 20:45:25 GMT