All Manuals > LispWorks® User Guide and Reference Manual > 38 The LISPWORKS Package

rotate-byte Function

Summary

Rotates specified bits within an integer.

Package

lispworks

Signature

rotate-byte count bytespec integer => result-integer

Arguments
count
An integer.
bytespec
A byte specifier.
integer
An integer.
Values
result-integer
An integer.
Description

The function rotate-byte returns integer with the bits specified by bytespec rotated left by count bits. Other bits remain the same as in integer. If count is negative, then the effect is to rotate right.

Examples
(rotate-byte 2 (byte 3 1) 99) => 105
(rotate-byte -2 (byte 3 1) 99) => 101
See also

http://www.cliki.net/rotate-byte


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:41