Results

Binary
Decimal
Hexadecimal
Octal

Data Source and Methodology

Authoritative reference: Donald E. Knuth, “The Art of Computer Programming, Volume 2: Seminumerical Algorithms,” 3rd Edition, Addison‑Wesley, 1997. ISBN: 0-201-89684-2. Official page: https://www-cs-faculty.stanford.edu/~knuth/taocp.html

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formulas Explained

Value of a numeral in base b: N = \sum_{i=0}^{k-1} d_i\, b^{i}

Change of base (iterative division): N = q_0 \, b + r_0,\; q_0 = q_1 \, b + r_1,\; \ldots, digits are the remainders r_i read in reverse.

Binary addition with carry: s_i = a_i \oplus b_i \oplus c_i,\quad c_{i+1} = (a_i b_i) \lor (c_i (a_i \oplus b_i))

Integer division: A = BQ + R,\quad 0 \le R < |B|

Bitwise (mask to n bits): x_{\text{masked}} = x \,\&\, (2^{n}-1)

Glossary of Variables and Outputs

  • Input base: The numeral system of the entered values (2, 8, 10, or 16).
  • Operand A, Operand B: Integer inputs for arithmetic or bitwise operations.
  • Operator: +, −, ×, ÷ for arithmetic; AND, OR, XOR, NOT for bitwise.
  • Bit width (n): The number of bits used to mask bitwise results.
  • Binary/Decimal/Hex/Octal: Result representations of the computed value.
  • Quotient, Remainder: Outputs for division where A = B × Quotient + Remainder.

How It Works: A Step-by-Step Example

Goal: Add two binary numbers and verify the result.

  1. Select “Arithmetic” and the “+” operator. Set Input base to Binary.
  2. Enter A = 1011011 and B = 111010.
  3. The calculator computes the sum: 1011011_2 + 111010_2 = 10010101_2.
  4. Verification in decimal: 1011011_2 = 64+16+8+2+1 = 91; 111010_2 = 32+16+8+2 = 58; 91+58=149; and 149_{10} = 10010101_2.

Frequently Asked Questions (FAQ)

What input formats are accepted?

Integers only. Optional prefixes 0b, 0o, and 0x are recognized, as well as underscores for readability, and a leading minus sign for arithmetic and conversion.

How are bitwise NOT and masking handled?

NOT flips bits within the chosen width n. All bitwise results are masked to stay in the range 0 to 2ⁿ−1.

Can I divide and get both quotient and remainder?

Yes. Choose ÷ in Arithmetic mode; you’ll see both the main result and a detailed row with quotient and remainder in all bases.

How do you ensure accuracy?

All computations use JavaScript BigInt for arbitrary-precision integers, avoiding rounding errors associated with floating point.

Why don’t you support fractions?

Supporting fractional conversions is complex and often ambiguous across bases. To remain fast, precise, and accessible, this tool focuses on integer operations.

Is the tool accessible?

Yes. It follows WCAG 2.1 AA with visible focus states, keyboard operability, descriptive labels, and ARIA messaging for inline validation.

Tool developed by Ugo Candido. Content verified by CalcDomain Editorial Team.
Last reviewed for accuracy on: .