Bitmanipulation in Ada

From: Bernd Specht (Bernd.Specht_at_gmx.com)
Date: 08/18/04


Date: 18 Aug 2004 20:37:08 GMT

Hi,

i have some questions regarding bitmanipulations:

1. I found bitwise "and", "or" and "xor" operations, but as far as I
understand they are applicable only for modular types or packed boolean
arrays. Is this correct?

2. I did not found shift and rotate operations. Did I miss something or are
there really none?

3. When I want treat a value both as an integer and as a boolean array, how
can i do this? In pascal I would use a tagless record like

TYPE ov is record
  case boolean of
    true : i : integer;
    false : byte_array;
  end;
  end;

Such overlay structures are not valid with Ada, so what do instead?

thanks



Relevant Pages

  • Re: what am i doing wrong here?
    ... I've written a Java method that uses a list to return 5 three-dimensional arrays containing 'Big Decimal' entries. ... However I also want to return a single boolean type variable, but cant seem to get the program to do this. ... I have declared the boolean type LDMexists, so I cant see what I'm doing wrong here - how do I get it to return the five arrays and the boolean variable LDMexists? ...
    (comp.lang.java.programmer)
  • Re: what am i doing wrong here?
    ... I've written a Java method that uses a list to return 5 three-dimensional arrays containing 'Big Decimal' entries. ... However I also want to return a single boolean type variable, but cant seem to get the program to do this. ... I have declared the boolean type LDMexists, so I cant see what I'm doing wrong here - how do I get it to return the five arrays and the boolean variable LDMexists? ... This adds a reference to the Boolean object to the arraylist. ...
    (comp.lang.java.programmer)
  • Re: working with byte arrays
    ... faster than my current solution because the whole comparisson is done inside ... Thanks for the hint to check the size of the arrays, ... BAs Byte) As Boolean ... > same lower bound, then these can be simplified to these... ...
    (microsoft.public.vb.general.discussion)
  • Re: what am i doing wrong here?
    ... I've written a Java method that uses a list to return 5 three-dimensional arrays containing 'Big Decimal' entries. ... However I also want to return a single boolean type variable, but cant seem to get the program to do this. ... I have declared the boolean type LDMexists, so I cant see what I'm doing wrong here - how do I get it to return the five arrays and the boolean variable LDMexists? ...
    (comp.lang.java.programmer)
  • Re: what am i doing wrong here?
    ... I've written a Java method that uses a list to return 5 three-dimensional arrays containing 'Big Decimal' entries. ... However I also want to return a single boolean type variable, but cant seem to get the program to do this. ... I have declared the boolean type LDMexists, so I cant see what I'm doing wrong here - how do I get it to return the five arrays and the boolean variable LDMexists? ...
    (comp.lang.java.programmer)