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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-31 02:27:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-036-245.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Quality systems (Was: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died)) Date: Sat, 31 May 2003 11:30:18 +0200 Organization: At home Message-ID: References: <3ec4b1c9$1@news.wineasy.se> <9fa75d42.0305161748.1735fc32@posting.google.com> <4W%xa.28765$cK5.11964@nwrdny02.gnilink.net> <1053353256.804734@master.nyc.kbcfp.com> <3ECFF541.1010705@attbi.com> <3ED0B820.5050603@noplace.com> <3ED74584.1050007@noplace.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-036-245.arcor-ip.net (145.254.36.245) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1054373270 7612701 145.254.36.245 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:38186 Date: 2003-05-31T11:30:18+02:00 List-Id: Marin David Condic wrote: > No, I don't think so. I've got regular old integers and floats and fixed > points that can generate an exception and let me stop and write out a > report. The usage I would have for it is the case where I want to > compute a position or rate and if it exceeds some limit, just chop it > off and press onwards. (Often computation speed in this domain is > critical) We usually do this manually with if-checks around the results > of a computation. It just doesn't protect you in the event of an > overflow that would generate an exception. The exception is "bad" > because your typical response is to reboot the control and start over - > and we all know what a bad thing that can be from the Ariane 5 disaster. > :-) I think it is a bad desgin. You definitely do not need a staturated arithmetics if you control something. The type of the data sent to an actor is not (and should not be) same as the type used in computations. In my view it should be: type Controlled_Value is new Float ...; type Actor_Value is private; function Saturate (X : Controlled_Value) return Actor_Value; private type Actor_Value is new Integer range 0..2048; For example, you compute with corner moment (normal arithmetic!) and then convert it to an number for an DAC (saturated or more sophisticated translation, but no arithmetic at all) which results in some voltage. An extreme example is Fourier transformation. You definitely would not use *real* arithmetics in the space of images. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de