From: Adam Beneschan <adam@irvine.com>
Subject: Re: Question about ordinary fixed point types.
Date: Mon, 16 Aug 2010 13:58:05 -0700 (PDT)
Date: 2010-08-16T13:58:05-07:00 [thread overview]
Message-ID: <4e7a9db2-aac8-4208-942a-be2207f3a9f0@f6g2000pro.googlegroups.com> (raw)
In-Reply-To: 4c699f8c$0$2369$4d3efbfe@news.sover.net
On Aug 16, 1:28 pm, "Peter C. Chapin" <chap...@acm.org> wrote:
> On 2010-08-16 08:53, Dmitry A. Kazakov wrote:
>
> > type Angle_Type is delta 0.0005 range -3.1416 .. 3.1416;
> > Angle : Angle_Type;
> > begin
> > Angle := Angle_Type'First;
> > while Angle < Angle_Type'Last loop
> > ... -- Work with Angle here.
> > Angle := Angle_Type'Succ (Angle);
> > end 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
next prev parent reply other threads:[~2010-08-16 20:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-15 21:43 Question about ordinary fixed point types Peter C. Chapin
2010-08-15 21:55 ` Shark8
2010-08-16 0:46 ` Peter C. Chapin
2010-08-16 4:13 ` Jeffrey Carter
2010-08-16 8:57 ` Simon Wright
2010-08-15 22:08 ` Yannick Duchêne (Hibou57)
2010-08-16 1:03 ` Peter C. Chapin
2010-08-16 4:11 ` Jeffrey Carter
2010-08-16 10:03 ` Ludovic Brenta
2010-08-17 14:35 ` sjw
2010-08-17 15:51 ` Ludovic Brenta
2010-08-16 11:31 ` Peter C. Chapin
2010-08-16 9:23 ` Simon Wright
2010-08-16 15:47 ` Simon Wright
2010-08-17 14:37 ` sjw
2010-08-16 11:02 ` Stephen Leake
2010-08-16 11:29 ` Peter C. Chapin
2010-08-16 12:53 ` Dmitry A. Kazakov
2010-08-16 20:28 ` Peter C. Chapin
2010-08-16 20:58 ` Adam Beneschan [this message]
2010-08-16 13:01 ` Dmitry A. Kazakov
2010-08-16 14:28 ` Robert A Duff
2010-08-16 20:31 ` Peter C. Chapin
2010-08-16 23:01 ` Robert A Duff
2010-08-16 23:17 ` Peter C. Chapin
2010-08-17 0:56 ` Robert A Duff
2010-08-17 2:03 ` Stephen Leake
2010-08-20 1:21 ` Yannick Duchêne (Hibou57)
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox