This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* __int1 : integer | |
* __int2 : integer | |
* Integers are from 0 till 2 ^ 31 - 1. When integers become greater than 2 ^ 31 then they will become a real and the handler wont't work. | |
*) | |
on BWAND(__int1, __int2) | |
set theResult to 0 | |
repeat with bitOffset from 30 to 0 by -1 | |
if __int1 div (2 ^ bitOffset) = 1 and __int2 div (2 ^ bitOffset) = 1 then | |
set theResult to theResult + 2 ^ bitOffset |
NewerOlder