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,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada with C Date: Fri, 06 Aug 2010 17:49:14 +0100 Organization: A noiseless patient Spider Message-ID: References: <0ee9eec7-6024-4fb8-8df0-f65c146e4b84@i28g2000yqa.googlegroups.com> <143ef70b-7e74-426b-a621-a5fd157849be@x21g2000yqa.googlegroups.com> <06eb8f61-2a0c-4dda-93f3-8414d32b6e4f@f20g2000pro.googlegroups.com> <87pqxwrwtz.fsf@hugsarin.sparre-andersen.dk> <1t7qv7gn9gugg$.alpj3tkmkw1y$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 6 Aug 2010 16:49:14 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="3491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VE6BYHCrr1lmAoR5HESjE7ITZYZlWmso=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:9HaI7G/B0qhbzKJ5cSv5sTD+/Go= sha1:7EnMcwnrcuTyNyDKo1Jt/LOJBRE= Xref: g2news1.google.com comp.lang.ada:12910 Date: 2010-08-06T17:49:14+01:00 List-Id: "Dmitry A. Kazakov" writes: > On Fri, 06 Aug 2010 10:04:24 +0200, Jacob Sparre Andersen wrote: > >> Ada novice wrote: >> >>> Can we change the subtype to Long_Long_Float? This will be of 18 >>> precision digits [...] >> >> That's not guaranteed. If you want 18 digits, you should declare the >> type (My_Float?) as: >> >> type My_Float is digits 18; > > Further, practically you should never use subtype in the form > > subtype My_Float is Long_Float; > > except for special cases like: > > subtype Non_IEEE_Float is Long_Float range Long_Float'Range; > > or > > subtype Non_Negative_Float is Long_Float range 0.0..Long_Float'Last; Depends what you mean by "practically". The thought process was, "I'm going to be writing a set of demo cases which should work for arbitrary floating-point types, I'll call the type My_Float. Shall I use type My_Float is new ... or subtype My_Float is ...? Doesn't really matter, go for subtype."