comp.lang.ada
 help / color / mirror / Atom feed
From: anton@idec.stc.co.uk (Anton Gibbs)
Subject: Numeric Conversion
Date: Wed, 11-Jun-86 13:55:09 EDT	[thread overview]
Date: Wed Jun 11 13:55:09 1986
Message-ID: <678@argon.idec.stc.co.uk> (raw)

We are relatively new to using Ada and, whilst learning the  language,
have  used  as a guideline the principle that there always seems to be
an Ada way of doing things.  Whenever code we have written  turns  out
to be messy in Ada, subsequent analysis has revealed that a different,
better approach leads to a neater solution.  Usually it  is  the  data
modelling that is wrong.

Now we have encountered a problem, trivial by  nature,  which  has  us
baffled.   The problem is simply that of obtaining the integer part of
a positive fixed-point value.  We can find no simple way of  achieving
this  in Ada: use of numeric conversion leads to uncertainty regarding
the direction of rounding (ARM 4.6 p7).

No doubt we are going wrong again somewhere, but we cannot see  where.
Maybe  just wanting to examine the integer part of a fixed-point value
is against the principles of Ada real numbers.

Any ideas ?

Thanks in advance.
--

Regards,

	  Anton Gibbs    <..seismo!mcvax!ukc!stc!idec!anton>
			 +44 438 726161 x8283

             reply	other threads:[~1986-06-11 17:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-06-11 17:55 Anton Gibbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
1986-06-12  8:57 Numeric Conversion Eyal mozes
replies disabled

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