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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f71c159449d6e114 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada 83 - avoiding unchecked conversions. Date: 1996/11/29 Message-ID: #1/1 X-Deja-AN: 201408713 references: <329C63BC.41C6@lmco.com> organization: New York University newsgroups: comp.lang.ada Date: 1996-11-29T00:00:00+00:00 List-Id: Mary asks "we have two 16 bit integers which we need to assemble into a single 32 bit integer (one is high order, the other low order). We wish to avoid unchecked conversion if we can. Is there a standard accepted way of doing this? " I always wonder when people say "I want to do X without using the obvious method for doing X". Can you explain why you don't want to use unchecked conversion here. Is there a real technical reason, or simply some kind of arbitrary rule in action? Of course you can do this assembly using multiplication (X * 2**16 + y). which is more appropriate depends on EXACTLY the abstract semantics of what you are doing (I mean which of unchecked conversion or multiplication)