math_bitwise_calculator
Perform bitwise operations (AND, OR, XOR, NOT, NAND, NOR, shifts) on integers with selectable input base and bit width, returning results in binary, octal, decimal, and hex simultaneously.
Instructions
Bitwise Calculator. Perform a bitwise operation on integers with a selectable input base and bit width. operation chooses AND, OR, XOR, NOT, NAND, NOR, or a shift (shl, shr, ushr); pass operation=parse instead to just convert one value into all four bases. Operands accept base 2/8/10/16 (optional 0x/0b/0o prefix) at width 32 or 64, signed or unsigned, and the result is returned in binary, octal, decimal, and hex at once. Use this for bit-level logic and shifts; use conversion_number_base for plain radix conversion and math_scientific_calculator for arithmetic expressions. Pure local computation: read-only, non-destructive, deterministic, contacts no external service, and is rate-limited (60 requests/min anonymous).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Bitwise op to run. and/or/xor/nand/nor need a and b; not is unary (a only); shl/shr/ushr shift a left or right by b bits (shr is arithmetic when signed, ushr is logical). Use parse to convert value into every base instead. | and |
| a | Yes | First operand (or the value to shift). String or number in base aBase; optional 0x/0b/0o prefix must match aBase. Negative only allowed when signed is true. Not used when operation=parse. | |
| b | No | Second operand for and/or/xor/nand/nor, or the shift count (0 to width-1) for shl/shr/ushr, in base bBase. Omit for not and parse. | |
| aBase | No | Radix used to read operand a. 2=binary, 8=octal, 10=decimal, 16=hex. | |
| bBase | No | Radix used to read operand b / the shift count. | |
| width | No | Integer bit width. Operands are masked to this width; shift counts must be less than it. | |
| signed | No | Interpret values as two's-complement signed (allows negative input and arithmetic shr) when true; unsigned when false. | |
| value | No | operation=parse only: the value to convert into all four bases, read using fromBase. | |
| fromBase | No | operation=parse only: radix of value. Required when operation=parse. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | True when the operation succeeded. | |
| operation | No | Echoes the requested operation (and/or/.../parse). | |
| result | No | Bitwise op returns a/b/operation/width/signed plus a nested result with binary/octal/decimal/hex. operation=parse returns value/fromBase/width/signed/decimal/binary/octal/hex. |