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 Date: Tue, 16 Jan 2007 15:47:54 +0100 From: Gautier User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Translating an embedded C algorithm References: <1168871816.263502.212100@11g2000cwr.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 83.76.150.170 X-Original-NNTP-Posting-Host: 83.76.150.170 Message-ID: <45ace573$1_3@news.bluewin.ch> X-Trace: news.bluewin.ch 1168958835 83.76.150.170 (16 Jan 2007 15:47:15 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:8174 Date: 2007-01-16T15:47:54+01:00 List-Id: Vo, Anh (US SSA) wrote: A micro-detail: the translation is an occasion to get rid of plenty of *%@�!* useless parentheses: < if (Adc_Count < MINIMUM_ADC_COUNT) then .. < elsif (Adc_Count > MAXIMUM_ADC_COUNT) then .. < TempDiff := (Table(Index) - Table (Index+1)); .. < Temperature := < Table(Index) - ((TempDiff * InterpolationDistance) / SPACING); > if Adc_Count < MINIMUM_ADC_COUNT then .. > elsif Adc_Count > MAXIMUM_ADC_COUNT then .. > TempDiff := Table(Index) - Table (Index+1); .. > Temperature := > Table(Index) - (TempDiff * InterpolationDistance) / SPACING; A question: I see all the time things like "if (.. < ..)" in C - are the parentheses required there ? ______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm