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) returns 4.
  • (lsh 2 -1) returns 1.
  • (lsh 40 2) returns 160.

Availability

  • AutoCAD 2026: documented.
  • BricsCAD V26: presumed compatible.
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.