comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@earthlink.net>
Subject: Re: Assignment of small Float values
Date: 2000/04/30
Date: 2000-04-30T00:00:00+00:00	[thread overview]
Message-ID: <390BABF3.6D5055F@earthlink.net> (raw)
In-Reply-To: 8efj12$87e$1@slb2.atl.mindspring.net

David W. Glessner <david_glessner@my-deja.com> 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.)




  reply	other threads:[~2000-04-30  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-17  0:00 Assignment of small Float values David W. Glessner
2000-04-29  0:00 ` swhalen
2000-04-30  0:00   ` Robert I. Eachus [this message]
2000-05-02  0:00 ` Disturbing float conversions jboulais
2000-05-02  0:00   ` JP Thornley
2000-05-11  0:00     ` jboulais
2000-05-13  0:00       ` JP Thornley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox