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,FREEMAIL_FROM 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!news2.google.com!news.germany.com!aioe.org!not-for-mail From: Cesar Rabak Newsgroups: comp.lang.ada Subject: Re: Translating an embedded C algorithm Date: Fri, 19 Jan 2007 17:15:14 -0200 Organization: Aioe.org NNTP Server Message-ID: References: <1168871816.263502.212100@11g2000cwr.googlegroups.com> <45acc0c3$0$22514$39db0f71@news.song.fi> <45af9c60$0$22524$39db0f71@news.song.fi> <87y7o01e4y.fsf@ludovic-brenta.org> <45b080e8$0$22527$39db0f71@news.song.fi> NNTP-Posting-Host: zEJK12x7djBBvRARhduGQA.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org In-Reply-To: User-Agent: Thunderbird 1.5.0.8 (X11/20061109) Xref: g2news2.google.com comp.lang.ada:8341 Date: 2007-01-19T17:15:14-02:00 List-Id: Niklas Holsti escreveu: > Cesar Rabak wrote: >> Ludovic Brenta escreveu: >> >>> Niklas Holsti writes: >>> [...] >>> >>> private package Thermometer.Some_Particular_Kind_Of_Sensor is >>> type Count_T is range 0 .. 1024; >> >> The ADC is ten bit, so it should be: "type Count_T is range 0 .. >> 1023;" -- 2#11111_11111# > > In this case, I find the base-2 literal harder to read -- how many 1's > are there really? My eyes cross if I try to count them... Perhaps the > best form is 2**10 - 1, as in Steve's version of the function. > The three forms for me are OK while they are the correct representation (for the OP) of the 10 bit ADC spec.