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,65b3f028266fd999 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!f6g2000pro.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Question about ordinary fixed point types. Date: Mon, 16 Aug 2010 13:58:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4e7a9db2-aac8-4208-942a-be2207f3a9f0@f6g2000pro.googlegroups.com> References: <4c685fac$0$2373$4d3efbfe@news.sover.net> <82aaomvn02.fsf@stephe-leake.org> <4c692129$0$2385$4d3efbfe@news.sover.net> <1xarkuqagkd1r.163fdxm099vjw.dlg@40tude.net> <4c699f8c$0$2369$4d3efbfe@news.sover.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1281992285 3735 127.0.0.1 (16 Aug 2010 20:58:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 16 Aug 2010 20:58:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f6g2000pro.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13432 Date: 2010-08-16T13:58:05-07:00 List-Id: On Aug 16, 1:28=A0pm, "Peter C. Chapin" wrote: > On 2010-08-16 08:53, Dmitry A. Kazakov wrote: > > > =A0 =A0type Angle_Type is delta 0.0005 range -3.1416 .. 3.1416; > > =A0 =A0Angle : Angle_Type; > > begin > > =A0 =A0Angle :=3D Angle_Type'First; > > =A0 =A0while Angle < Angle_Type'Last loop > > =A0 =A0 =A0 ... -- Work with Angle here. > > =A0 =A0 =A0 Angle :=3D Angle_Type'Succ (Angle); > > =A0 =A0end loop; > > That's cool. I didn't realize I could use Succ with a fixed point type. > I thought that was only for discrete types... or is a fixed point type a > kind of discrete type (it would make sense for it to be). I guess I can > look that one up. :) It's not a discrete type. However, starting with Ada 95, 'Pred and 'Succ have been defined for fixed-point and floating-point types. For fixed-point types, 'Succ is defined to have the same result as adding the 'Small of the type. 3.5(22-24). -- Adam