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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,421379614df5a9cd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!94.232.116.14.MISMATCH!feed.xsnews.nl!border-4.ams.xsnews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Range excluding 0.0 Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <6f1ce89e-7889-4d58-b0f8-1945727f5149@f33g2000vbm.googlegroups.com> <1j57hiw.vmezw81qexbi6N%csampson@inetworld.net> Date: Sun, 30 Aug 2009 09:34:06 +0200 Message-ID: <1t74k6wjtgo78.1b6d2g7uwt230$.dlg@40tude.net> NNTP-Posting-Date: 30 Aug 2009 09:34:01 CEST NNTP-Posting-Host: e498a867.newsspool4.arcor-online.net X-Trace: DXC=Aff0K[hI7oG2jYf>V4L0gL4IUK On Sat, 29 Aug 2009 16:51:56 -0400, John B. Matthews wrote: > In article <1j57hiw.vmezw81qexbi6N%csampson@inetworld.net>, > csampson@inetworld.net (Charles H. Sampson) wrote: > > [...] >> This is not just theoretical musing. I currently work in the >> world of compasses, so a range of the form [0.0 .. 360.0) is quite >> natural. (That notation is neither mathematical nor Ada. I hope its >> meaning is clear.) > > I'd be torn between these, but wrapping around the right end would be a > problem with either: > > subtype Heading is Float range 0.0 .. 360.0; > subtype Heading is Float range 0.0 .. Float'Pred(360.0); > > If the range were intended to model a craft's heading (perhaps in > degrees, minutes & seconds), I'd be tempted to consider a modular type: Still using non-metric units, guys? (:-)) > type Heading is mod 360 * 60 * 60; > > This might make a relative change in heading easier to implement. Second : constant := 1.0 / (60.0 * 60.0); type Heading is delta Second range 0.0..360.0 - Second; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de