comp.lang.ada
 help / color / mirror / Atom feed
From: joe@petsd.UUCP (Joe Orost)
Subject: Logical arithmetic on integer operands
Date: Fri, 13-Jun-86 23:57:21 EDT	[thread overview]
Date: Fri Jun 13 23:57:21 1986
Message-ID: <785@petsd.UUCP> (raw)

<>
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

                 reply	other threads:[~1986-06-14  3:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox