comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol@pvv.org>
Subject: Re: fixed type (delta) in ada
Date: 1999/11/29
Date: 1999-11-29T08:02:01+00:00	[thread overview]
Message-ID: <m3ogcdwws5.fsf@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: 3841B57A.42C70EC0@easystreet.com

Al Christians <achrist@easystreet.com> writes:

| Next question: I haven't seen where it says that
| 
| Money_Io.Put(0.20 * 351.0);
| 
| Should put 68.55, which is what GNAT 3.12p does.  My guess 
| would be that 0.20 * 351.0 should be a static expression of 
| type universal real, which should convert to type Money 
| equal to 70.2 within +/- 0.01.  Is it according to the LRM 
| to convert both the 0.20 and 351.0 to the Money type before 
| doing the multiply?  Any other explanations?

It has to do with fixed point types and Decimal types (the prior gives
68.55 the latter gives 70.2). If available see "Programming in Ada 95"
2.ed by John Barnes (ISBN: 0-201-34293-6) chapter 15.5 and 15.6. 
-- 
Preben Randhol -- [randhol@pvv.org] -- [http://www.pvv.org/~randhol/]     
"Det eneste trygge stedet i verden er inne i en fortelling." 
                                             -- Athol Fugard




  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 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 [this message]
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
1999-11-29  0:00         ` Lutz Donnerhacke
1999-11-29  0:00           ` Preben Randhol
1999-11-28  0:00 ` Nick Roberts
1999-11-30  0:00   ` Simon Wright
replies disabled

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