bitwise-operations-calculator
Run a bitwise operation (AND, OR, XOR, NOT, <<, >>, >>>) on two BigInt operands and return the result in decimal, hex, binary, octal, plus the low-32-bit binary representation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First integer as a string. Can be decimal ('255'), hex ('0xff' or 'ff'), binary ('0b1010' or '1010'), or octal ('0o17' or '17'). The `base` field tells the engine how to parse it. | |
| b | No | Second integer as a string. Required for AND, OR, XOR, and the three shifts. Ignored for NOT (unary). | |
| op | Yes | Operation: and (&), or (|), xor (^), not (~), shl (<<), shr (>> arithmetic right shift), ushr (>>> logical right shift on the low 32 bits). | |
| base | Yes | How to parse a and b: dec, hex, bin, or oct. | dec |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | The operation that ran, echoed for display. | |
| bin | Yes | Result in binary, prefixed with 0b. Negative values are signed (leading minus). | |
| dec | Yes | Result as a decimal string. | |
| hex | Yes | Result in hexadecimal, prefixed with 0x. Negative values are signed (leading minus). | |
| oct | Yes | Result in octal, prefixed with 0o. Negative values are signed (leading minus). | |
| bits32 | Yes | Low 32 bits of the result as a binary string, MSB on the left. Used for the visual grid. | |
| exceeds32 | Yes | True when the result does not fit in a signed 32-bit integer. |