Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This may be very basic, but I can't seem to find bitwise operators in Scripts.
My input includes an integer that is a collection of set bits. I wish to do bitwise operations on this integer to pick out specific bits that are set.
How can I do this?
Hi,
This is what help says:
"
All bit operators convert the operands to signed integers (32 bit) and return the result in the same way. All operations are performed bit by bit.
bitnot | Bit inverse. | Unary operator. The operation returns the logical inverse of the operand performed bit by bit. |
bitand | Bit and. | The operation returns the logical AND of the operands performed bit by bit. |
bitor | Bit or. | The operation returns the logical OR of the operands performed bit by bit. |
bitxor | Bit exclusive or. | The operation returns the logical exclusive or of the operands performed bit by bit. |
>> | Bit right shift. | Unary operator. The operation returns the operand shifted one step to the right. |
<< | Bit left shift. | Unary operator. The operation returns the operand shifted one step to the left. |
"
Does this help?
Regards, tresesco
Hi,
This is what help says:
"
All bit operators convert the operands to signed integers (32 bit) and return the result in the same way. All operations are performed bit by bit.
bitnot | Bit inverse. | Unary operator. The operation returns the logical inverse of the operand performed bit by bit. |
bitand | Bit and. | The operation returns the logical AND of the operands performed bit by bit. |
bitor | Bit or. | The operation returns the logical OR of the operands performed bit by bit. |
bitxor | Bit exclusive or. | The operation returns the logical exclusive or of the operands performed bit by bit. |
>> | Bit right shift. | Unary operator. The operation returns the operand shifted one step to the right. |
<< | Bit left shift. | Unary operator. The operation returns the operand shifted one step to the left. |
"
Does this help?
Regards, tresesco
Hi Tresesco,
Can you give any example, this would really help me...
Thank & Regards,
Upendra
Please check
http://en.wikipedia.org/wiki/Bitwise_operation
So one simple example in a textbox:
= 10 bitand 3
results in 2
Hey swuehl,
Thanks for the reply, it helps me a lot.
Thanks & Regards