Big Integer and the Bit Operations Support


Version: 2019

Type: Features

Category: Programming

Subcategory: Origin C

Jira: ORG-17751


LabTalk now supports big integers which are higher than 32bit values (up to 52 bits), and their bitwise operations:
Conversion to an integer: int(), nint(), ceil(), floor()
Bitwise operators: (&(AND) and |(OR))
Bitwise functions: BitAnd(), BitOr(), BitXor(), BitLShift(), BitRShift()
  for example:
    i=hex(F1101010101);
    j=hex(F2010101011);
    Dec2hex(bitAnd(i,j),12)$=;     //==>0F0000000001
    Dec2hex(bitOr(i,j),12)$=;       //==>0F3111111111
    Dec2hex(bitXor(i,j),12)$=;      //==>003111111110
    Dec2hex(bitLShift(i,3),12)$=; //==>788808080808
    Dec2hex(bitRShift(i,3),12)$=; //==>01E220202020