[net.lang.ada] Logical arithmetic on integer operands

joe@petsd.UUCP (Joe Orost) (06/14/86)

<>
A while ago, someone requested a portable package to perform logical
operations on integer operands.  The following portable public-domain 
package has been sent to the Ada Repository on SIMTEL20:

package logical is

   -- return arg rotated count bits.  
   -- If count < 0, rotate is to the right,
   -- else, rotate is to the left.
   function rotate(arg, count : integer) return integer;

   -- return arg logically shifted count bits.
   -- bits shifted out either end are lost
   -- If count < 0, shift is to the right,
   -- else, shift is to the left
   function shift(arg, count : integer) return integer;

   -- return left XOR right
   function "xor"(left, right : integer) return integer;

   --return left AND right
   function "and"(left, right : integer) return integer;

   --return left OR right
   function "or" (left, right : integer) return integer;

   --return NOT right
   function "not"(right       : integer) return integer;
end logical;

				regards,
				joe

--

 Full-Name:  Joseph M. Orost
 UUCP:       ihnp4!vax135!petsd!joe
 ARPA:	     vax135!petsd!joe@BERKELEY
 Phone:      (201) 758-7284
 Location:   40 19'49" N / 74 04'37" W
 US Mail:    MS 313; Concurrent Computer Corporation; 106 Apple St
             Tinton Falls, NJ 07724