comp.lang.ada
 help / color / mirror / Atom feed
From: Ada novice <ycalleecharan@gmx.com>
Subject: Re: understanding floating point types
Date: Sun, 22 Aug 2010 03:37:35 -0700 (PDT)
Date: 2010-08-22T03:37:35-07:00	[thread overview]
Message-ID: <7b0ca24f-4a5e-43a9-9f71-e4adffb98694@q1g2000yqg.googlegroups.com> (raw)
In-Reply-To: mt3els2pgx78$.1dwj1p44vk16d.dlg@40tude.net

On Aug 22, 11:51 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> Compare:
>
>    type My_Float is digits 1;
>
> My_Float'Machine_Mantissa = 24 (32-bit IEEE 754 is used to model it)
> My_Float'Mantissa = 5 (= 4+1)
>
>    type My_Float is digits 2;
>
> My_Float'Machine_Mantissa = 24 (32-bit IEEE 754 is used to model it)
> My_Float'Mantissa = 8 (= 7+1)

Thanks. The Float'Machine_Mantissa remains constant in your examples
with 1 and 2 precision digits. Is the Float'Machine_Mantissa a
predefined value that is constant for any precision digit requested?

I have a second query: Say we consider the type My_Float is digits 2.
This means that between the model numbers, the resolution is 1/(2^8)
with the 8 in the expression obtained as 4 X 2. Am I right? Now if we
have to multiply two numbers: say a = 2.33 and b = 3.45. Does Ada
first convert each operation to its nearest model number and then do
the multiplication and represent the result to its nearest model
number? Or does Ada do the multiplication first and then represent the
result to to its nearest model number?


Thanks
YC



  reply	other threads:[~2010-08-22 10:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-22  9:11 understanding floating point types Ada novice
2010-08-22  9:51 ` Dmitry A. Kazakov
2010-08-22 10:37   ` Ada novice [this message]
2010-08-22 10:39     ` Ada novice
2010-08-22 13:57     ` Dmitry A. Kazakov
2010-08-22 17:15       ` Ada novice
2010-08-22 18:16         ` Dmitry A. Kazakov
2010-08-22 19:05           ` Ada novice
2010-08-22 19:34             ` Dmitry A. Kazakov
2010-08-23  6:29               ` Ada novice
2010-08-23  6:40                 ` J-P. Rosen
2010-08-23  7:13                 ` Dmitry A. Kazakov
2010-08-23  7:15             ` Martin
2010-08-23 11:42               ` Ada novice
2010-08-24 12:14                 ` Ada novice
2010-08-24 14:05                   ` Jacob Sparre Andersen
2010-08-24 14:36                     ` Ada novice
2010-08-22 17:22       ` Yannick Duchêne (Hibou57)
2010-08-22 18:49         ` Ada novice
replies disabled

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