* 设置指定位为1 * 自动扩展:当索引超过 64 时,自动扩展到 128/256 位 * @param index 位索引(0-based) * @throws 当位索引为负数时抛出错误
(index: number)
| 32 | * @throws 当位索引为负数时抛出错误 |
| 33 | */ |
| 34 | public set(index: number): void { |
| 35 | if (index < 0) { |
| 36 | throw new Error('Bit index cannot be negative'); |
| 37 | } |
| 38 | |
| 39 | BitMask64Utils.setBit(this._value, index); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * 清除指定位为0 |