Sizely
Integer Calculator

Integer Calculator

Integer calculator: type any problem with negative numbers, brackets, +, -, * and / to get the answer. Learn the sign rules with worked examples.

Annie Button

Written by

Annie Button

Updated

There was an error with your calculation.

Answer

-167

Integer calculator at a glance#

What is an integer?#

An integer is a whole number with no fraction or decimal part. It can be positive, negative, or zero: ..., −3, −2, −1, 0, 1, 2, 3, and so on in both directions. 7 and −3 are integers, while 3.5 and 1/2 are not.

How do you add and subtract negative numbers?#

To add, think of a number line: adding a positive number moves you right and adding a negative number moves you left. For subtraction, add the opposite, so −3 − (−7) becomes −3 + 7 = 4. Enter the entire problem into the calculator above, using brackets where necessary, and it will return the answer.

What integer is equal to −17 − (18 − 16)?#

The expression −17 − (18 − 16) simplifies to −19. First, resolve the brackets: 18 − 16 equals 2. Then calculate −17 − 2, which gives −19, and this indicates a move of 2 further to the left from −17. Enter it into the calculator as -17 - (18 - 16).

Integers and the number line#

On a number line, positive integers extend to the right of 0, and negative integers extend to the left. Each integer has an opposite that is the same distance from 0 on the other side, so the opposite of 7 is −7. The distance from 0 is called the absolute value: |−3| = 3 and |7| = 7.

A bigger number means further to the right. −3 is greater than −10, even though 10 is larger than 3, because −3 is positioned to the right of −10. This page uses one pair of numbers throughout: −3 and 7.

Adding integers#

There are two rules to remember, and they are based on the signs. OpenStax Prealgebra 2e explains the same two scenarios.

When the signs are the same, you add the absolute values and keep the original sign. For −3 + (−7), add 3 and 7 to get 10 and keep the minus sign: −10.

When the signs differ, subtract the smaller absolute value from the larger one and retain the sign of the number with the larger absolute value. For instance, with −3 plus 7, subtract 3 from 7 to get 4. Since 7 has the larger absolute value, the result is 4. In the case of 3 plus (−7), subtract 3 from 7 to achieve 4. However, since −7 has the larger absolute value, the final answer is −4.

Visualizing this on the number line, consider −3 plus 7. You start at −3 and shift 7 units to the right. You pass 0 after 3 steps and stop 4 steps further, at 4.

Three number lines: −3 + 7 moves 7 to the right from −3 to 4, −3 − (−7) is the same move and also lands on 4, and −3 − 7 moves 7 to the left from −3 to −10
Adding a positive or subtracting a negative moves right, subtracting a positive moves left.

Subtracting integers#

Subtracting is defined as adding the opposite: a − b = a + (−b). OpenStax describes this concept as the subtraction property. You change the subtraction into addition and then flip the sign of the second number, applying the rules for addition.

For example, if you have −3 − 7, it becomes −3 + (−7), which is −10. Since both numbers are negative, you add 3 and 7 and keep the minus sign. Another case, with −3 − (−7), changes to −3 + 7, giving you 4. Removing a negative is equivalent to adding a positive.

On a number line, subtracting 7 shifts the position left by 7 places, while subtracting −7 shifts it right by 7 places. This means that −3 − 7 lands at −10, and −3 − (−7) lands at 4.

Multiplying and dividing integers#

To multiply or divide integers, start by working with their absolute values. OpenStax provides a simple rule: if the integers have the same signs, the result is positive. If they have different signs, the result is negative.

Think of multiplying as repeated addition. For example, 7 multiplied by (−3) signifies making seven jumps of −3, starting at 0 and ending at −21. When dividing, you reverse this process: for instance, −21 divided by 7 equals −3. This is because −21 is split into 7 equal jumps of −3.

A number line from −21 to 0 with seven jumps of −3 starting at 0 and landing on −21, so 7 × (−3) = −21 and −21 ÷ 7 = −3
Seven jumps of −3 from 0 land on −21.

When you're dealing with more than two numbers, count the negative signs. If you have an even number of negatives, the result is positive. An odd number gives a negative outcome. So, if you multiply (−1) by (−2) and then by (−3), you have three negatives, so the answer is −6.

Order of operations#

The calculator follows the standard order of operations: start with brackets, then powers, followed by multiplication and division from left to right, and finally addition and subtraction from left to right. Consider the example already loaded above: (−33) − 28 + −45 − (97 − 36). First, solve the bracketed operation: 97 minus 36 equals 61. Then proceed from the left: −33 minus 28 gives −61, and −61 plus (−45) gives −106. Finally, −106 minus 61 equals −167.

Be cautious with minus signs when dealing with powers. For instance, −22 means −(22), giving −4 because powers are computed before applying the minus. If you need to square −2, enter (-2)^2 to get the result 4.

Typing problems into the calculator#

In the calculator above, type a full expression on a single line. Use + and - for addition and subtraction, * for multiplication, / for division, ^ to indicate powers, and brackets to group parts of the expression. The calculator doesn't recognize the symbols × and ÷, so you should substitute * and / respectively. When a number appears next to a bracket, it implies multiplication, so typing -3(-7) gives 21. Two signs in succession are also valid: for example, 5 - -3 equals 8.

Division might give a non-integer result. For instance, -7/2 is −3.5. The calculator provides the decimal outcome without rounding it to an integer. If you need a whole-number quotient with a remainder, the long division calculator should be used. To round off a decimal to the nearest whole number, opt for the rounding calculator.

Where integers are used#

Temperature#

Consider a morning temperature of −3 °F. If the temperature increases by 7 degrees, it reaches 4 °F. This is calculated as −3 + 7 = 4. A decrease of 7 degrees from −3 °F results in −10 °F.

Money#

A negative integer represents a bank balance below zero. If an account shows −33 dollars and a deposit of 28 dollars is made, the balance becomes −33 + 28 = −5 dollars, which is still an overdraft by 5.

Sports scores#

In golf, scores are measured against par. If rounds score −3 and +7, they sum to +4, which is 4 over par. In football, a loss of 3 yards followed by a gain of 7 yards results in a net gain of 4 yards.

Answers to common integer problems#

These problems are frequently searched for. The middle column illustrates how to input each one into the calculator.

Answers to common integer problems
ProblemType It AsAnswer
−17 − (18 − 16)-17 - (18–16)−19
20 − (−8)20 - (-8)28
25 − 4525–45−20
−8 − (−22)-8 - (-22)14
−20 + 32-20 + 3212
−40 + 30-40 + 30−10
−20 + (−4)-20 + (-4)−24
−8 − (−20)-8 - (-20)12
−40 − (−10)-40 - (-10)−30
−23 + (−17)-23 + -17−40
−3 − 6-3–6−9
−3 × (−7)-3 * (-7)21
−21 ÷ (−3)-21 / (-3)7
43 + (−2)44^3 + (-2)^480

Sources#

Frequently asked questions#

Is 0 an integer?#

Yes, 0 is an integer that is neither positive nor negative. It is its own opposite, and adding 0 to any integer leaves it unchanged.

Are fractions and decimals integers?#

No, unless they equal a whole number. 3.5 and 1/2 are not integers, but 8/4 is, because it equals 2. While all integers are rational numbers, most rational numbers aren't integers.

Why does a negative times a negative give a positive?#

Look at the pattern. −3 × 2 = −6 and −3 × 1 = −3, and then −3 × 0 = 0. Each time the second number goes down by 1, the answer goes up by 3. Continuing this, −3 × (−1) = 3, and −3 × (−7) = 21.

What is −2 squared?#

This depends on the brackets. (−2)2 means (−2) × (−2) = 4. Without brackets, −22 means the negative of 2 squared, which is −4. The calculator follows this rule, so to square a negative number, type (-2)^2.

What happens when integers don't divide evenly?#

You get a decimal or a fraction, not an integer. In the calculator, −7 ÷ 2 shows as −3.5. As a mixed number, that's −3 1/2, and the mixed number calculator handles answers in that form.

How large an integer can the calculator handle?#

Whole numbers can stay exact up to 9,007,199,254,740,991. Beyond that, numbers are stored with about 16 significant digits, so the last digits get rounded. For example, 260 shows as 1152921504606847000, though the exact value is 1,152,921,504,606,846,976.