LOTUSSCRIPT 言語
以下に例を示します。
anInt% = 8 Print Bin$(anInt%) ' Output:1000 anotherInt% = Not anInt% Print Bin$(anotherInt%) ' Output: 11111111 11111111 11111111 11110111
2 つの数値オペランドと 1 つのビット単位演算子で構成される式は、Integer 型または Long 型の値 (または一方のオペランドが NULL の場合は NULL) に評価されます。ビット単位演算の結果のデータ型を決定する規則は、次のとおりです。
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
関連項目