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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3f2ed3f93fdb688b X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: Assignment of small Float values Date: 2000/04/30 Message-ID: <390BABF3.6D5055F@earthlink.net>#1/1 X-Deja-AN: 617381248 Content-Transfer-Encoding: 7bit References: <8dfm0q$8nr$1@nnrp1.deja.com> <8efj12$87e$1@slb2.atl.mindspring.net> X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 957066196 63.24.57.140 (Sat, 29 Apr 2000 20:43:16 PDT) Organization: The MITRE Corporation MIME-Version: 1.0 NNTP-Posting-Date: Sat, 29 Apr 2000 20:43:16 PDT Newsgroups: comp.lang.ada Date: 2000-04-30T00:00:00+00:00 List-Id: David W. Glessner wrote: > Why does GNAT treat the non-zero constant as 0.0 in the assignment to > F1 in the following example? 32-bit IEEE floating-point should > support values down to around 10**-38 (and even down to 10**-45 or > so for subnormal numbers). Jumping in where angels fear to tread--because it is so difficult to explain the "correct" answer: First, the realistic answer: It is probably a bug. Second, the language lawyerly answer: If you did not compile in strict mode, you cannot reason about the arithmetical model at all. If this problem occurs in strict mode, and if the exponent is greater than S'Model_Emin (not T'Machine_Emin), then the compiler fails to comply with the standard. If there are in fact no model numbers between 6.6666666666666666E-33 and 0.0, then the implementation is valid. (The trickiness here is that for some floating point representations without gradual underflow, there is a significant gap in the model numbers on either side of zero. In other words, the gap between the model number just above zero and zero is much greater than the gap between that model number and the model number next above it.)