Article View: comp.lang.fortran
Article #6521Re: Precision of floating point multiply
From: Sven Pran
Date: Sat, 27 Sep 2003 16:54
Date: Sat, 27 Sep 2003 16:54
57 lines
3585 bytes
3585 bytes
"robin" wrote > "Glen Herrmannsfeldt" writes: > > According to his description, until 1963 IBM Fortran compilers would > > generate double precision results for floating point multiply of two single > > precision numbers, at least when it was being summed into a double precision > > variable. He then explains that IBM changed this in IBSYS 13, anticipating > > S/360. > > > > As far as I can tell, the Fortran-66 standard requires a single precision > > product when multiplying single precision numbers, though I don't know how > > much impact IBM had on Fortran-66. > > > > The reason why this comment is surprising to me is that S/360 (along with > > S/370 and ESA/390) do not have a single precision multipy instruction with a > > single precision product. The product is always double precision. > > While this is true, it is also true that subsequent single-precision > operations using the result will use only the single-precision > product. With the Fortran language as implemented on IBM computers in the 360 series you specified all variables either implicit or explicit. Variables having names beginning with one of the characters "I" through "N" were INtegers by default, the rest were single precision real numbers by default. How the multiplication was performed internally mattered very little for code something like A = B * C. According to the specifications for the Fortran compiler all real number calculations were carried out at maximum precision for intermediate results; rounding to the specific precision took place only when a result was stored in the target variable. Therefore the result for: Y = some second calculation on (the result of some first calculation on (A,B,C) ) could very well be different from the result for: Y := some first calculation on: (A, B, C) followed by Y = some second calculation on (Y) because also the intermediate result was rounded in the second case, not in the first. Sven
Technical Details
Message-ID:
<8hjdb.33172$Hb.505372@news4.e.nsc.no>Path:
arc1-ca.pugleaf.net!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!news4.e.nsc.no.POSTED!53ab2750!not-for-mailReferences:
<h%gdb.126241$bo1.40978@news-server.bigpond.net.au>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: fd705,7830916812112af0 X-Google-Attributes: gidfd705,public X-Google-Thread: 101deb,860da5e114d00659 X-Google-Attributes: gid101deb,public X-Google-Thread: 102b75,7830916812112af0 X-Google-Attributes: gid102b75,public X-Google-Thread: f8131,860da5e114d00659 X-Google-Attributes: gidf8131,public X-Google-Thread: 1094ba,7830916812112af0 X-Google-Attributes: gid1094ba,public X-Google-ArrivalTime: 2003-09-27 09:54:30 PST Path: arc1-ca.pugleaf.net!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!news4.e.nsc.no.POSTED!53ab2750!not-for-mail From: "Sven Pran" <no.direct@mail.please> Newsgroups: comp.lang.fortran,comp.lang.asm370,comp.lang.pl1,comp.arch,bit.listserv.ibm-main,alt.folklore.computers References: <h%gdb.126241$bo1.40978@news-server.bigpond.net.au> Subject: Re: Precision of floating point multiply Lines: 59 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <8hjdb.33172$Hb.505372@news4.e.nsc.no> NNTP-Posting-Host: 80.212.78.154 X-Complaints-To: news-abuse@telenor.net NNTP-Posting-Date: Sat, 27 Sep 2003 18:54:28 MEST X-Trace: news4.ulv.nextra.no 1064681668 80.212.78.154 Date: Sat, 27 Sep 2003 18:54:22 +0200