Mathwords logoMathwords

Negative Base — Definition, Formula & Example

A negative base is a place-value system whose base is a negative integer such as −2 or −10. Because the place values alternate in sign, you can write every integer, positive or negative, using only nonnegative digits and no minus sign.

Fix an integer b≥2b \ge 2. A base −b-b numeral dndn−1…d1d0d_n d_{n-1} \ldots d_1 d_0 with digits dk∈{0,1,…,b−1}d_k \in \{0, 1, \ldots, b-1\} denotes the integer ∑k=0ndk(−b)k\sum_{k=0}^{n} d_k(-b)^k. Every integer has exactly one such representation without leading zeros. Base −2 is called negabinary, and base −10 is called negadecimal.

Key Formula

N=∑k=0ndk (−b)k,0≤dk≤b−1N = \sum_{k=0}^{n} d_k\,(-b)^k, \qquad 0 \le d_k \le b-1
Where:
  • NN = The integer being represented. It may be positive, negative, or zero.
  • −b-b = The negative base, where b is an integer with b ≥ 2.
  • dkd_k = The digit in position k. It is always a nonnegative integer less than b.
  • kk = The position index, counting from 0 at the rightmost digit.
  • nn = The position of the leftmost (highest) digit.

Worked Example

Problem: Write the integer −5 in base −2 (negabinary). Then check your answer.
Step 1: Divide by −2 repeatedly. Each remainder must be 0 or 1. Start with −5. The quotient 3 works because it leaves a remainder of 1. Then divide 3 by −2, which gives quotient −1 and remainder 1.
−5=(−2)(3)+1,3=(−2)(−1)+1-5 = (-2)(3) + 1, \qquad 3 = (-2)(-1) + 1
Step 2: Keep dividing until the quotient reaches 0.
−1=(−2)(1)+1,1=(−2)(0)+1-1 = (-2)(1) + 1, \qquad 1 = (-2)(0) + 1
Step 3: Read the remainders from last to first, which gives 1111. To check, multiply each digit by its place value: 1, −2, 4, and −8 from right to left.
1(−8)+1(4)+1(−2)+1(1)=−51(-8) + 1(4) + 1(-2) + 1(1) = -5
Answer: −5=1111−2-5 = 1111_{-2}. The digits are all 1s, and the number carries no minus sign.

Why It Matters

Negative bases appear in discrete math and computer architecture courses. They show that a number's sign can come from the place values themselves instead of from a separate sign bit or a two's-complement rule. Donald Knuth discusses them in The Art of Computer Programming, Volume 2, and the Polish UMC-1 computers of the late 1950s did their arithmetic in negabinary.

Common Mistakes

Mistake: Accepting a negative remainder during division. For example, students write −5 ÷ (−2) = 2 with remainder −1.
Correction: A digit can never be negative. If the remainder comes out negative, add 1 to the quotient and add b to the remainder. Here 2 R −1 becomes 3 R 1, because (−2)(3) + 1 = −5.

Related Terms

  • Integers — The full set a negative base represents uniquely
  • Negative Number — Written here without any minus sign
  • Digit — Fills each position, always from 0 to b−1
  • Nonnegative — Required property of every digit in this system
  • Base Ten System — The familiar positive-base system this one modifies
  • Base of an Exponent — Explains why powers of a negative base alternate sign