From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.102.97 with SMTP id fn1mr37104354pab.7.1430698516336; Sun, 03 May 2015 17:15:16 -0700 (PDT) X-Received: by 10.50.61.231 with SMTP id t7mr107138igr.14.1430698516300; Sun, 03 May 2015 17:15:16 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!l13no13490094iga.0!news-out.google.com!kd3ni7465igb.0!nntp.google.com!l13no13490086iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 3 May 2015 17:15:15 -0700 (PDT) In-Reply-To: <142zdljlf0w57.1xh4g0wxv88y8.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=123.2.70.40; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le NNTP-Posting-Host: 123.2.70.40 References: <1kxou0nloqg9c$.1x0itzgdrlosm$.dlg@40tude.net> <1i8x3r1feyzkt$.j85il7e3wpv9.dlg@40tude.net> <142zdljlf0w57.1xh4g0wxv88y8.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: getting same output as gfortran, long_float From: robin.vowels@gmail.com Injection-Date: Mon, 04 May 2015 00:15:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:25713 Date: 2015-05-03T17:15:15-07:00 List-Id: On Friday, May 1, 2015 at 5:45:23 PM UTC+10, Dmitry A. Kazakov wrote: > On Fri, 01 May 2015 02:32:27 -0500, Nasser M. Abbasi wrote: > > > Actually, it is much more complicated. The way I wrote it > > above is not the optimal way. One is supposed to call > > SELECTED_REAL_KIND(n,e) requesting n significant digits > > and e number of digits in the exponent (e is optional). > > Huh, they finally learned something after half of a century! (:-)) > > > i.e. one is supposed to write > > > > SELECTED_REAL_KIND(8,3) specifies real type of > > (+-) 0.xxxxxxxx * 10 ^(+-)xxx > > > > If the compiler does not support this, then the compile > > will fail. This is in a way similar to Ada's > > > > type my_type is digits n; > > Yes, though Ada also mandates that for the precision specified, the > implementation must guarantee certain accuracy of operations. Maybe in the > following 50 years FORTRAN will get that idea as well. > > > And it is supposed to be portable way of doing things, vs. > > using Real*16. > > Actually REAL*16 is exactly portable. No it's not. Some compilers treat that is an error. That form is non-standard. SELECTED_REAL_KIND or a similar modern form is how precision may be specified in a portable manner.