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: <EACHUS.91Jun12211653@largo.mitre.org>
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


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...
