dart:core
庫中int.operator_bitwise_and
方法的用法介紹如下。
用法:
int operator &(
int other
)
位和運算符。
將 this
和 other
都視為足夠大的二進製分量整數,結果是一個數字,其中僅設置了在 this
和 other
中設置的位
如果兩個操作數都為負,則結果為負,否則結果為非負。
print((2 & 1).toRadixString(2)); // 0010 & 0001 -> 0000
print((3 & 1).toRadixString(2)); // 0011 & 0001 -> 0001
print((10 & 2).toRadixString(2)); // 1010 & 0010 -> 0010
相關用法
- Dart int.operator_bitwise_exclusive_or用法及代碼示例
- Dart int.operator_bitwise_or用法及代碼示例
- Dart int.operator_shift_left用法及代碼示例
- Dart int.operator_triple_shift用法及代碼示例
- Dart int.operator_shift_right用法及代碼示例
- Dart int.fromEnvironment用法及代碼示例
- Dart int.toUnsigned用法及代碼示例
- Dart int.bitLength用法及代碼示例
- Dart int.parse用法及代碼示例
- Dart int.toRadixString用法及代碼示例
- Dart int.tryParse用法及代碼示例
- Dart int.gcd用法及代碼示例
- Dart int.toSigned用法及代碼示例
- Dart identityHashCode用法及代碼示例
- Dart identical用法及代碼示例
- Dart MapMixin.containsKey用法及代碼示例
- Dart Iterator用法及代碼示例
- Dart AttributeClassSet.intersection用法及代碼示例
- Dart num.sign用法及代碼示例
- Dart TransformList.last用法及代碼示例
- Dart FileList.first用法及代碼示例
- Dart CanvasRenderingContext2D.drawImageScaledFromSource用法及代碼示例
- Dart FileList.length用法及代碼示例
- Dart Iterable.takeWhile用法及代碼示例
- Dart LinkedHashMap用法及代碼示例
注:本文由純淨天空篩選整理自dart.dev大神的英文原創作品 operator & method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。