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,f822ae7b0f7433c1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Thu, 18 Jan 2007 22:30:53 +0200 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Translating an embedded C algorithm References: <1168871816.263502.212100@11g2000cwr.googlegroups.com> <45acc0c3$0$22514$39db0f71@news.song.fi> <45af9c60$0$22524$39db0f71@news.song.fi> In-Reply-To: <45af9c60$0$22524$39db0f71@news.song.fi> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <45afd7be$0$22525$39db0f71@news.song.fi> Organization: TDC Song Internet Services NNTP-Posting-Host: laku61.adsl.netsonic.fi X-Trace: 1169151934 news.song.fi 22525 81.17.205.61:32895 X-Complaints-To: abuse@song.fi Xref: g2news2.google.com comp.lang.ada:8280 Date: 2007-01-18T22:30:53+02:00 List-Id: A correction, or improvement: Niklas Holsti wrote: > ... > package Temperatures is > > type Celsius_T is delta 0.1 digits 5 range -40.0 .. 120.0; ^ I have little experience with fixed-point types, but I think "digits 4" should actually be enough in this case (-40.0 .. 120.0). At least the code works with "digits 4", too. Anyway, Gnat says the minimum 'Size of the type is 12 bits in both cases, so I guess the variables have the same size and arithmetic the same speed in both cases (except, perhaps, if we multiply or divide two values of this type, but this example code does not do that.) -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .