JCL Help:Sar@Integer@TBitRange

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Performs an arithmetic right shift.


Pascal

 function Sar(const Value: Shortint; const Count: TBitRange): Shortint; overload;
function Sar(const Value: Smallint; const Count: TBitRange): Smallint; overload;
function Sar(const Value: Integer; const Count: TBitRange): Integer; overload;


Parameters

Parameters Description
const Value: Shortint The Value whose bits to arithmetically shift.
const Count: TBitRange Number of positions to right shift.


Return Value

A copy of value after the arithmetic right shift operation.


Description

Sar performs an arithmetic right shift on the operand. An arithmetic right shift is similar to a logical right shift (shr) except that shr operates on unsigned values while Sar operates on signed values (and as such preserves the sign).


About

Unit

JclLogic


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page