(lsh integer1 integer2)


Do a bitwise shift.


This function performs a logical shift of bits. Integer1 denotes the number, while integer2 denotes the number of bits to shift integer1. When integer2 is positive, it shifts to the left; negative shifts to the right.

lsh works with integers only. The 1 signifies the bit is on; the 0 signifies it is off.

 

Examples

Code Returns
(lsh 12 1) 24
(lsh 8 -1) 4
(lsh 24 3) 192

 

Tell me about...

(~ number)

(and expression ...)

(boole function integer1 integer2 ...)

(logand integer1 integer2 …)

(logior integer1 integer2 …)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved.