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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-30 02:44:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!newsfeed1.uni2.dk!news.get2net.dk.POSTED!53ab2750!not-for-mail Sender: malo@niflheim.malonet Newsgroups: comp.lang.ada Subject: Re: Quality systems (Was: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died)) 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> From: Mark Lorenzen Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 30 May 2003 13:47:02 +0200 NNTP-Posting-Host: 62.84.221.216 X-Complaints-To: abuse@colt-telecom.dk X-Trace: news.get2net.dk 1054287839 62.84.221.216 (Fri, 30 May 2003 11:43:59 CEST) NNTP-Posting-Date: Fri, 30 May 2003 11:43:59 CEST Organization: Colt Telecom Kunde Xref: archiver1.google.com comp.lang.ada:38063 Date: 2003-05-30T13:47:02+02:00 List-Id: Marin David Condic writes: > While you guys are at the business of creating new numeric types for > Ada0y, how about one of my favorite types - some form of a saturated > math type? It would be nice to have support for the basic math types > that would saturate instead of wrap-around or overflow/exception. How > difficult or inefficient would that be to implement? > > MDC > The idea of a saturated math type is elegant, but don't you want a mechanism for checking if a variable has saturated (fx. for logging purposes)? Something like: X := X + 5; if X'Saturated then -- report unexpected saturation end if; Use_Value(X); -- and so on The attribute 'Saturated would apply to a variable X of a saturated type and return true if and only if the last value assignment to X had to be adjusted to fit the range of X. - Mark