comp.lang.ada
 help / color / mirror / Atom feed
From: Al Christians <achrist@easystreet.com>
Subject: Re: fixed type (delta) in ada
Date: 1999/11/29
Date: 1999-11-29T00:00:00+00:00	[thread overview]
Message-ID: <3842A11A.6833A317@easystreet.com> (raw)
In-Reply-To: 81tue8$evd$1@nnrp1.deja.com

How about this one:

---------------------------------------------------------

with Ada.Text_Io;

procedure Money_Test is 

   -- type money is delta 0.01 digits 10 range 0.0..10_000_000.00;
   type Money is delta 0.01 range 0.0 .. 10_000_000.00; 

   -- package money_io is new ada.text_io.decimal_io(money);
   package Money_Io is new Ada.Text_Io.Fixed_Io(Money);

   F : Long_Float := 0.0300000000000000;  

begin
   Money_Io.Put(Money(F));                   -- GNAT 3.12p Puts 0.03
   Money_Io.Put(Money(0.0300000000000000));  -- GNAT 3.12p Puts 0.02 
end Money_Test;

----------------------------------------------------------------

I suppose that 0.02 and 0.03 are each allowed, but I find the
inconsistency a little unexpected.


Al  


Robert Dewar wrote:
> 
> In article <38409C87.69EC865@easystreet.com>,
>   Al Christians <achrist@easystreet.com> wrote:
> > > No, the output should be 71.3, and this is what is expected.
> >
> > So, why does GNAT 3.12p give 68.55?
> >
> > Al
> >
> 
> That's also an allowed output value in this case!
>




  reply	other threads:[~1999-11-29  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-27  0:00 fixed type (delta) in ada Nap
1999-11-26  0:00 ` Al Christians
1999-11-27  0:00   ` fixed type (delta) in ada and GNAT bug David C. Hoos, Sr.
1999-11-28  0:00 ` fixed type (delta) in ada Nick Roberts
1999-11-30  0:00   ` Simon Wright
1999-11-28  0:00 ` Robert Dewar
1999-11-27  0:00   ` Al Christians
1999-11-28  0:00     ` Preben Randhol
1999-11-28  0:00     ` Florian Weimer
1999-11-28  0:00       ` Al Christians
1999-11-29  0:00         ` Preben Randhol
1999-11-29  0:00           ` Al Christians
1999-11-29  0:00             ` Preben Randhol
1999-11-29  0:00     ` Robert Dewar
1999-11-29  0:00       ` Al Christians [this message]
1999-11-29  0:00         ` Lutz Donnerhacke
1999-11-29  0:00           ` Preben Randhol
replies disabled

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