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!news4.google.com!news3.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Translating an embedded C algorithm Date: Fri, 19 Jan 2007 20:49:13 +0000 Organization: Pushface 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: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1169239754 21982 62.49.19.209 (19 Jan 2007 20:49:14 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 19 Jan 2007 20:49:14 +0000 (UTC) Cancel-Lock: sha1:KujcXdTxdkdHhz0Nj2lIJFRd980= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:8351 Date: 2007-01-19T20:49:13+00:00 List-Id: Niklas Holsti writes: > 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. I suppose it would depend on whether your roots were in octal or hex; personally I started on an F1600 where the address fields were 5-bits wide, so I instantly recognise 11111 as 31, but most would prefer 2#11_1111_1111# or 2#1_111_111_111# if we have to use base 2. Steve wins, though!