unit Int;

interface

uses
  Classes, SysUtils;

type
  TInt = Int64;
  TIntSize = Byte;

function LimitSize(Value: TInt; Size: TIntSize): TInt;


implementation

function LimitSize(Value: TInt; Size: TIntSize): TInt;
begin
  Result := Value and ((1 shl (Size * 8)) - 1);
end;

end.

