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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8c0fcfc0a87e61fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!transit3.readnews.com!news-xxxfer.readnews.com!textspool1.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Date: Thu, 30 Sep 2010 09:30:25 -0400 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: simple question on long_float/short_float References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4ca491aa$0$2444$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: 5b20b6f1.news.sover.net X-Trace: DXC=Q>OPZ>N`2MdT\\2aA1_H?jK6_LM2JZB_c1cO;Mh[inMh:WUUlR<856o;B3njnU2l9loN:7S;?Y_8j X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:14333 Date: 2010-09-30T09:30:25-04:00 List-Id: On 2010-09-30 04:45, Nasser M. Abbasi wrote: > So Ada has > > Float, > long_float, > short_float, > Interfaces.Fortran.Reals > Interfaces.Fortran.Double_Precision A common recommendation is to avoid using the built-in types directly. Instead define your own: type My_Floating_Type is digits 12; If the implementation has a floating point type with at least 12 decimal digits of precision it will use it as the base type for My_Floating_Type and all will be well. If the implementation can't handle that much precision in any of its built-in types you will get a compile time error. For example you could try type My_Floating_Type is digits 350; But I doubt if there is any implementation that will honor that. The types in Interfaces.Fortran are intended for the case where you are exchanging data with a corresponding Fortran compiler. It sounds like you might, in fact, be doing that. Peter