Decimal long division calculator

:

Decimal long division algorithm

Multiplying the dividend and divisor by the same nonzero number does not change the quotient.

  1. Count decimal places. Count the digits after the decimal separator in both numbers. An integer has zero decimal places.
  2. Choose a power of 10. Let n be the larger count. Multiply both numbers by 10ⁿ, shifting both decimal separators n places to the right and adding zeros as needed. Both numbers are now integers.
  3. Divide the integers. Work with absolute values. If the dividend is smaller than the divisor, write 0 in the integer part of the quotient. Otherwise find the first partial dividend at least as large as the divisor. Divide, multiply, subtract and bring down digits.
  4. Find fractional digits if necessary. When the original digits run out and the remainder is nonzero, insert a decimal point in the quotient and append zeros one at a time. Continue until the remainder is zero, repeats, or six decimal places have been found.
  5. Determine the sign. A nonzero quotient is negative if the signs differ, and nonnegative otherwise.

The divisor must not be zero. Multiply both numbers even when only one has decimal places.