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,UTF8 Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Thu, 18 Jan 2007 02:49:49 -0600 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: AW: Translating an embedded C algorithm References: <878xg2aqzr.fsf@ludovic-brenta.org> Date: Thu, 18 Jan 2007 09:49:48 +0100 Message-ID: <87k5zk7m8j.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:3y7nJgz9Ih/PaACRb4GyXvqVy0I= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 62.235.206.39 X-Trace: sv3-HOGdteP3O7xSDIOFfxObKWi64gNYZQnglYp97L/QU86OHxiQ7n7hb7Mt6SVIjnWatF/6XXboUFDI+A5!SXTq3/WyhmZ/qponRr5Mt/MHjUMPzGBl2ga9gg158ekDdTOY9bYkCmI+keHXLhC2XnZrHznGDw== X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:8244 Date: 2007-01-18T09:49:48+01:00 List-Id: Markus E Leypold writes: > Ludovic Brenta writes: >> Right, and there would be no need for a silly INVALID_TEMPERATURE. >> What *is* an invalid temperature anyway? One that needs crutches? >> One that is excused from military service? And why would you ever >> return an invalid temperature to your caller? etc. etc. > > | >> --| Temperature in ÂșC x 10. INVALID_TEMPERATURE if out of range. > > If the sensor is out of order or the temperature leaves the range > where it functions properly? > > :-). My point it this: if the sensor is out of order, then there is no known temperature; not a known "invalid" temperature. The proper way to handle that in Ada is with an exception, not a special value of type Degrees_C. -- Ludovic Brenta.