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,e8b01e86b2d0a470 X-Google-Attributes: gid103376,public From: "Tarjei Tj�stheim Jensen" Subject: Re: how to do bit-wise operation on none modular types? Date: 1999/03/03 Message-ID: <7blipj$7k1@news.kvaerner.com>#1/1 X-Deja-AN: 451091584 Content-Transfer-Encoding: 7bit References: <7bj7ti$4i@drn.newsguy.com> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Kv�rner Oil & Gas Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-03-03T00:00:00+00:00 List-Id: bill@nospam wrote in message <7bj7ti$4i@drn.newsguy.com>... > >greetings, > >I have an integer value that is returned from some call (its status). > >I'd like to take the bit-wise "and" of this value against >another value (16#FFFF#). (i.e. in C, do: 0xffff & i) > >Ada does not allow this, as both operands must be modular integer types >(i.e. range from 0 to some positive value). > >what can one do? do I need to convert integer value returned from signed >to unsigned (i.e. modular)? how? Can you redefine the type of the value returned? E.g. either make it a modular integer type or make it a record and then check the various values instead of anding and oring? Greetings,