Function Entry: LSH
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: LSH
Name
lsh
Class
Function
Syntax
(lsh int numbits)
Arguments and Values
int: integer to be shifted.numbits: integer; positive shifts left, negative shifts right.
Description
Logical bitwise shift of int by numbits positions. Positive numbits shifts left; negative shifts right. Zero bits are shifted in, and bits shifted out are discarded.
Return Values
An integer. The result is positive if bit 31 (the sign bit) is 0 after the shift; otherwise the result is negative.
Side Effects
None.
Examples
(lsh 2 1)returns4.(lsh 2 -1)returns1.(lsh 40 2)returns160.
Availability
- AutoCAD 2026: documented.
- BricsCAD V26: presumed compatible.
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [lsh (AutoLISP 2026)](https://help.autodesk.com/cloudhelp/2026/ENU/AutoCAD-AutoLISP-Reference/files/GUID-3BC67533-3F4F-4C01-9053-CD82AA235AE8.htm)
- Status: documented (Phase 3 body fill).