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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Newsgroups: comp.lang.ada Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!linus!linus!linus!mbunix!eachus From: eachus@largo.mitre.org (Robert I. Eachus) Subject: Re: float constraint checks In-Reply-To: tedg@apollo.HP.COM's message of 12 Jun 91 19:00:54 GMT Message-ID: Sender: news@linus.mitre.org (News Service) Nntp-Posting-Host: largo.mitre.org Organization: The Mitre Corp., Bedford, MA. References: <1991Jun12.190054.27094@apollo.hp.com> Date: 12 Jun 91 21:16:53 List-Id: In article <1991Jun12.190054.27094@apollo.hp.com> tedg@apollo.HP.COM (Ted Grzesik) writes: I have a question regarding constraint checks of floating point assignments. The LRM (3.5.7) does not make it clear to me whether my compiler is failing to give a CONSTRAINT_ERROR in the following situation... Note: All code not shown. First of all, I assume the reference was to 4.5.7. But under no circumstances should this program raise CONSTRAINT_ERROR. You seem to believe that there should be an underflow check, but the Ada floating point model has no such concept. (All results which might be considered as underflow are represented by ANY value in a range bounded inclusively by zero and the smallest positive or negative safe number.) Where underflow and reduced acuracy are concerns in Ada, you either have to define your own floating-point operators (which for example would raise UNDERFLOW_ERROR), or use scaling and fixed point. -- Robert I. Eachus with STANDARD_DISCLAIMER; use STANDARD_DISCLAIMER; function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...