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 Path: g2news2.google.com!news1.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: Tue, 16 Jan 2007 11:32:23 -0200 Organization: Aioe.org NNTP Server Message-ID: References: <1168871816.263502.212100@11g2000cwr.googlegroups.com> NNTP-Posting-Host: zEJK12x7djBBvRARhduGQA.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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:8166 Date: 2007-01-16T11:32:23-02:00 List-Id: Vo, Anh (US SSA) escreveu: > -----Original Message----- From: comp.lang.ada-bounces@ada-france.org > [mailto:comp.lang.ada-bounces@ada-france.org] On Behalf Of Talulah > Sent: Monday, January 15, 2007 6:37 AM To: > comp.lang.ada@ada-france.org Subject: Translating an embedded C > algorithm > [snipped] > > Here I just translated directory to Ada from C code in the table. > Please pay attention to the Important Note below the Table. Note also > that I have slightly modified some variables for readability. Let me > know if more information is desired. > [snipped] I think a direct translation form C to Ada does not help to 'sell' Ada very well. In the PDF the OP mentions the ADC is 10 bit, so one of advantages of Ada, for example, would have been a restricted type for that. A minor but interesting snag is that the comments do not reflect accurately the working of code (C) and the present translation maintains it: "Returns: Temperature in �C x 10. INVALID_TEMPERATURE if out of range." There is no attribution of a such constant INVALID_TEMPERATURE in the whole function body! my 0.01999...