Decimal Calculator: Add, Subtract, Multiply, Divide and More
Enter any two decimal numbers, choose an operation and get the exact result with a full step-by-step breakdown. Supports addition, subtraction, multiplication, division, exponentiation, roots and base-10 logarithm. Adjust rounding precision from integers to 10 decimal places.
How to add and subtract decimal numbers
The key rule for adding or subtracting decimals is to align the decimal points vertically before performing the arithmetic. Pad the shorter number with trailing zeros so both numbers have the same number of digits after the decimal point, then add or subtract column by column from right to left, carrying or borrowing exactly as you would with whole numbers. The result has at most as many decimal places as the longer of the two inputs. For example, 3.75 + 1.25 becomes 3.75 + 1.25 = 5.00, which simplifies to 5.
How to multiply and divide decimal numbers
To multiply two decimals, multiply them as if they were integers and then count the total number of decimal places in both factors: the product has exactly that many decimal places. For 0.3 x 0.5, multiply 3 x 5 = 15, then place the decimal two places from the right to get 0.15. For division, multiply both the dividend and the divisor by the same power of 10 to make the divisor a whole number, then perform the division. Division of a decimal by another decimal can yield a repeating (non-terminating) decimal, so choosing an appropriate rounding precision is important.
Exponents, roots and logarithms of decimals
Raising a decimal to an integer power works by repeated multiplication: 1.5^3 = 1.5 x 1.5 x 1.5 = 3.375. Fractional exponents give roots: the n-th root of a number is the same as raising it to the power 1/n, so the square root of 2.25 is 2.25^0.5 = 1.5. Logarithms answer the question "what power must the base be raised to in order to reach this number?". This calculator uses the change-of-base formula: log_b(a) = ln(a) / ln(b), which works for any positive base other than 1. Results for roots and logarithms are almost always irrational, so selecting a precision of 6-10 decimal places gives the most faithful answer.
Understanding rounding precision
Rounding converts a long or repeating decimal to a manageable number of digits. When you choose 2 decimal places the calculator applies standard half-up rounding (sometimes called "round half away from zero"): if the next digit is 5 or above, the last kept digit rounds up. For financial calculations, 2 decimal places (cents) is usually correct. For scientific and engineering work, 6 to 10 decimal places preserves enough precision to avoid accumulated errors. If you need the exact symbolic fraction rather than a decimal approximation, consider a fraction calculator instead.
Decimal places in common arithmetic results
| Operation | Rule | Example |
|---|---|---|
| Addition | At most max(dp_a, dp_b) decimal places | 1.2 + 3.45 = 4.65 (2 dp) |
| Subtraction | At most max(dp_a, dp_b) decimal places | 5.100 - 2.3 = 2.8 (1 dp) |
| Multiplication | At most dp_a + dp_b decimal places | 0.3 x 0.5 = 0.15 (2 dp) |
| Division | Potentially non-terminating (repeating) | 1 / 3 = 0.333... (repeating) |
| Exponent | Depends on base and exponent | 1.5 ^ 2 = 2.25 (2 dp) |
| Root | Usually irrational, needs rounding | sqrt(2) = 1.4142... (irrational) |
| Logarithm | Usually irrational, needs rounding | log_10(2) = 0.3010... (irrational) |
How many decimal places to expect in the raw (unrounded) result of each operation.
Frequently asked questions
Why does 0.1 + 0.2 not equal exactly 0.3?
Most computers store numbers in binary (base-2), and many simple decimal fractions such as 0.1 and 0.2 cannot be represented exactly in binary, just as 1/3 cannot be written exactly in decimal. The result of 0.1 + 0.2 in binary floating-point is 0.30000000000000004, which rounds to 0.3 at 1 decimal place. This calculator rounds the final answer to your chosen precision, which eliminates these tiny binary-representation artefacts in almost every practical case.
How many decimal places should I use?
For money, 2 decimal places (cents or pence) is the standard. For science and engineering, 4-6 decimal places is typical. For pure mathematics or cryptography where exact representation matters, use 10 decimal places and also note whether the result is rational (terminates) or irrational (repeating). The "decimal places in result" output helps you see how many places the raw result has before rounding.
What is the difference between a root and an exponent?
They are inverse operations. Raising a to the power b asks "multiply a by itself b times". Taking the b-th root of a asks "what number, multiplied by itself b times, gives a?". This calculator treats the root as a ^ (1/b), so a square root uses b = 2 (giving a ^ 0.5), a cube root uses b = 3 (giving a ^ 0.333...), and so on.
Can this calculator handle negative decimals?
Yes for addition, subtraction, multiplication, division and odd-order roots. Even-order roots of negative numbers (for example the square root of -4) are not real numbers, so the calculator returns no result in that case. Logarithms require a positive number and a positive base different from 1.
What is a repeating decimal?
A repeating decimal is one where one or more digits repeat forever, such as 1/3 = 0.333... or 1/7 = 0.142857142857.... Division is the most common source. Rounding to a chosen number of decimal places gives a practical approximation. Any fraction p/q where q has prime factors other than 2 and 5 will produce a repeating decimal.