Sign in Join
FPDoc Onlineexperiment

SarSmallint function

In unit System

16-bit Shift Arithmetic Right.

Declaration

pascal
function SarSmallint(const AValue: SmallInt; const Shift: Byte=1)
: SmallInt

Description

SarSmallint performs an arithmetic right shift for Shift positions on an 16-bit integer AValue and returns the result. Shift is optional, and is 1 by default. The difference with the regular Shr shift operation is that the leftmost bit is preserved during the shift operation.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.