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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site petsd.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!hjuxa!petsd!joe From: joe@petsd.UUCP (Joe Orost) Newsgroups: net.lang.ada Subject: Logical arithmetic on integer operands Message-ID: <785@petsd.UUCP> Date: Fri, 13-Jun-86 23:57:21 EDT Article-I.D.: petsd.785 Posted: Fri Jun 13 23:57:21 1986 Date-Received: Tue, 17-Jun-86 08:47:28 EDT Reply-To: joe@petsd.UUCP (Joseph M. Orost) Organization: Perkin-Elmer DSG, Tinton Falls, N.J. Keywords: logical operations, public domain, portable List-Id: <> 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