# decimal-bitwise-operand

Disallow opaque decimal masks in bitwise operations

Multi-digit decimal masks obscure the bit pattern used by a bitwise operation.
Instead, you SHOULD write the mask in binary, hexadecimal, or octal notation.

- Category: style
- Level: warning
- Fix: none
- Scope: module

## Reported

```ds title="main.ds"
declare const value: uint32;
const masked = value & 240;
```

## Accepted

```ds title="main.ds"
declare const value: uint32;
const masked = value & 0xf0;
```

## Prior art

- [Clippy · decimal_bitwise_operands](https://rust-lang.github.io/rust-clippy/master/index.html#decimal_bitwise_operands)

[language/linter/src/rules/style/decimal_bitwise_operand.rs:7](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/decimal_bitwise_operand.rs#L7)
