Question
· Nov 27, 2016

bitwise integer arithmetic

Coming from a C/C++/C# background, I was expecting the & and | operators in Cache ObjectScript to perform bitwise operations on integers, but apparently they don't.

 

I checked the online documentation http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

but couldn't find any information on bitwise integer arithmetic.

 

So given the following code:

set x = 10  //bit pattern is : 1010

set y=3      //bit pattern is:   0011

What operator can be used to return z = x <BITWISE OR> y  = 1011 (binary) = 11 (decimal)

 

Thanks,

Bill

Discussion (2)0
Log in or sign up to continue