# How do I add or multiply integers?

Adds, subtracts, multiplies or divides positive and negative integers of any size, exactly, and explains the sign rule for each step.

- Page: https://www.acalculator.org/math/integer-calculator
- JSON spec: https://www.acalculator.org/math/integer-calculator.json
- Version: 54b062a3c4e3

## Default answer

Example with the default inputs (First integer -8, Operation +, Second integer 5): −8 + 5 = −3.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| a | First integer | A whole number, positive, negative or 0. |
| op | Operation | Add, subtract, multiply or divide. |
| b | Second integer | A whole number, positive, negative or 0. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Result | The exact answer; a quotient that is not whole is a fraction in lowest terms. |
| expression | Problem | The problem and its answer. |
| rule | Sign rule | The rule for the sign of the answer. |
| decimal | Decimal | A quotient as a decimal to 10 significant figures. |

## Method

Addition: same signs, add the absolute values and keep the sign; different signs, subtract the smaller absolute value from the larger and take the sign of the larger. Subtraction: a − b = a + (−b). Multiplication and division: same signs give a positive answer, different signs a negative one.

## Assumptions

- Integers can have any number of digits; the arithmetic is exact.
- A quotient that is not a whole number is shown as a fraction in lowest terms and as a decimal to 10 significant figures. Dividing by 0 has no answer.

## Worked examples

1. a = -8, op = add, b = 5 gives result = −3, expression = −8 + 5 = −3, rule = different signs: subtract 8 − 5 = 3 and take the sign of −8: −3. Source: OpenStax, Prealgebra 2e, §3.2 Add Integers (same signs: add and keep the sign; different signs: subtract, take the sign of the larger absolute value), https://openstax.org/books/prealgebra-2e/pages/3-2-add-integers (retrieved 2026-10-05).
2. a = -7, op = add, b = -4 gives result = −11, rule = same signs: add 7 + 4 = 11 and keep the sign: −11. Source: OpenStax, Prealgebra 2e, §3.2 Add Integers (same signs: add and keep the sign; different signs: subtract, take the sign of the larger absolute value), https://openstax.org/books/prealgebra-2e/pages/3-2-add-integers (retrieved 2026-10-05).
3. a = 3, op = sub, b = -6 gives result = 9, expression = 3 − (−6) = 9. Source: OpenStax, Prealgebra 2e, §3.3 Subtract Integers (a − b = a + (−b)), https://openstax.org/books/prealgebra-2e/pages/3-3-subtract-integers (retrieved 2026-10-05).
4. a = -9, op = mul, b = -4 gives result = 36, rule = same signs, so the answer is positive: 9 × 4 = 36, so 36. Source: OpenStax, Prealgebra 2e, §3.4 Multiply and Divide Integers (same signs give a positive, different signs a negative), https://openstax.org/books/prealgebra-2e/pages/3-4-multiply-and-divide-integers (retrieved 2026-10-05).
5. a = -63, op = div, b = 7 gives result = −9, decimal = −9. Source: OpenStax, Prealgebra 2e, §3.4 Multiply and Divide Integers (same signs give a positive, different signs a negative), https://openstax.org/books/prealgebra-2e/pages/3-4-multiply-and-divide-integers (retrieved 2026-10-05).
6. a = 10, op = div, b = -4 gives result = −5/2, decimal = −2.5. Source: OpenStax, Prealgebra 2e, §3.4 Multiply and Divide Integers (same signs give a positive, different signs a negative), https://openstax.org/books/prealgebra-2e/pages/3-4-multiply-and-divide-integers (retrieved 2026-10-05).
7. a = 123456789012345678901234567890, op = mul, b = -2 gives result = −246913578024691357802469135780. Source: OpenStax, Prealgebra 2e, §3.4 Multiply and Divide Integers (same signs give a positive, different signs a negative), https://openstax.org/books/prealgebra-2e/pages/3-4-multiply-and-divide-integers (retrieved 2026-10-05).

## FAQ

### How do you add integers with different signs?

Subtract the smaller absolute value from the larger, then take the sign of the number with the larger absolute value. −8 + 5: 8 − 5 = 3, and −8 is larger, so the answer is −3.

### How do you add two negative integers?

Add their absolute values and keep the minus sign: −7 + (−4) = −11.

### How do you subtract a negative integer?

Add its opposite. 3 − (−6) = 3 + 6 = 9.

### What is the rule for multiplying and dividing integers?

Same signs give a positive answer; different signs give a negative answer. −9 × −4 = 36 and −63 ÷ 7 = −9.

### What if the division does not come out even?

The answer is a fraction, not an integer. 10 ÷ (−4) = −5/2 = −2.5. The page shows the fraction in lowest terms and the decimal.

### How big can the integers be?

Any size. The page works with exact whole numbers, so 123456789012345678901234567890 × −2 keeps every digit.

## Sources

- OpenStax, Prealgebra 2e, §3.2 Add Integers: same signs, add and keep the sign; different signs, subtract and use the sign of the larger absolute value. CC BY 4.0. Retrieved 2026-10-05. https://openstax.org/books/prealgebra-2e/pages/3-2-add-integers
- OpenStax, Prealgebra 2e, §3.3 Subtract Integers: a − b = a + (−b). CC BY 4.0. Retrieved 2026-10-05. https://openstax.org/books/prealgebra-2e/pages/3-3-subtract-integers
- OpenStax, Prealgebra 2e, §3.4 Multiply and Divide Integers: same signs give a positive, different signs a negative. CC BY 4.0. Retrieved 2026-10-05. https://openstax.org/books/prealgebra-2e/pages/3-4-multiply-and-divide-integers
