LOTUSSCRIPT LANGUAGE
For example:
anInt% = 8 Print Bin$(anInt%) ' Output: 1000 anotherInt% = Not anInt% Print Bin$(anotherInt%) ' Output: 11111111 11111111 11111111 11110111
An expression consisting of two numeric operands and a bitwise operator evaluates to an Integer or Long value (or to NULL if one of the operands is NULL). The rules that determine the data type of the result of a bitwise operation are:
anInt% = 10 anotherInt% = 5 aDouble# = 2.6 Print Bin$(anInt%) ' Output: 1010 Print Bin$(anotherInt%) ' Output: 101 Print Bin$(aDouble#) ' Output: 11 theResult% = anInt% And anotherInt% Print Bin$(theResult%) ' Output: 0 theResult% = anInt% And aDouble# Print Bin$(theResult%) ' Output: 10 theResult% = anInt% Or anotherInt% Print Bin$(theResult%) ' Output: 1111 theResult% = anInt% Or aDouble# Print Bin$(theResult%) ' Output: 1011 theResult% = anInt% Xor anotherInt% Print Bin$(theResult%) ' Output: 1111 theResult% = anInt% Xor aDouble# Print Bin$(theResult%) ' Output: 1001 theResult% = anInt% Eqv anotherInt% Print Bin$(theResult%) ' Output: 11111111 11111111 11111111 11110000 theResult% = anInt% Eqv aDouble# Print Bin$(theResult%) ' Output: 11111111 11111111 11111111 11110110 theResult% = anInt% Imp anotherInt% Print Bin$(theResult%) ' Output: 11111111 11111111 11111111 11110101 theResult% = anInt% Imp aDouble# Print Bin$(theResult%) ' Output: 11111111 11111111 11111111 11110111
See Also