From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=5.0 tests=BAYES_40,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!stc!idec!anton From: anton@idec.stc.co.uk (Anton Gibbs) Newsgroups: net.lang.ada Subject: Numeric Conversion Message-ID: <678@argon.idec.stc.co.uk> Date: Wed, 11-Jun-86 13:55:09 EDT Article-I.D.: argon.678 Posted: Wed Jun 11 13:55:09 1986 Date-Received: Sat, 14-Jun-86 06:59:14 EDT Reply-To: anton@idec.stc.co.uk (Anton Gibbs) Organization: STC IDEC, Stevenage, UK List-Id: 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