# CTAN Update: longdivision

Does long division. The dividend must be a positive decimal number and the divisor must be a positive integer. Correctly handles repeating decimals, putting a bar over the repeated part of the decimal. Handles dividends up to 20 digits long gracefully (though the typeset result will take up about a page) and dividends between 20 and 60 digits long slightly less gracefully. Defines macros \longdivision and \intlongdivision. Each takes two arguments, a dividend and a divisor. \longdivision keeps dividing until the remainder is zero, or it encounters a repeated remainder. \intlongdivision stops when the dividend stops (though the dividend doesn't have to be an integer). \longdivision also has an optional argument "max_extra_digits". If max_extra_digits is 0, the behavior is like \intlongdivision, whereas if max_extra_digits is greater than 60, the behavior is the same as \longdivision without the optional argument. In general, \longdivision won't add more than "max_extra_digits". It might be prudent to use this optional argument if you are computing, say, 1/97 which has a 96 digit period (\longdivision will stop anyways to avoid overfull boxes, but the result might not be ideal). \intlongdivision behaves similarly to the \longdiv command defined in longdiv.tex, though I think \intlongdivision looks better, and it can handle much larger dividends and divisors (the dividend is only constrained by the size of the page, and the divisor can be up to 8 digits long).

The package’s Catalogue entry can be viewed at http://ctan.org/pkg/longdivision The package’s files themselves can be inspected at http://mirror.ctan.org/macros/latex/contrib/longdivision/

Thanks for the upload. For the CTAN Team Petra Rübe-Pugliese

We are supported by the TeX users groups. Please join a users group; see http://www.tug.org/usergroups.html .

## longdivision – Typesets long division

This package executes the long division algorithm and typesets the solutions. The dividend must be a positive decimal number and the divisor must be a positive integer. Repeating decimals is handled correctly, putting a bar over the repeated part of the decimal. Dividends up to 20 digits long are handled gracefully (though the typeset result will take up about a page), and dividends between 20 and 60 digits long slightly less gracefully.

The package defines two macros, `\longdivision` and
`\intlongdivision`. Each takes two arguments, a dividend
and a divisor. `\longdivision` keeps dividing until the
remainder is zero, or it encounters a repeated remainder.
`\intlongdivision` stops when the dividend stops (though
the dividend doesn’t have to be an integer).

This package depends on the xparse package from the l3packages bundle.

Package | longdivision |

Version | 1.2.1 2021-07-17 |

Maintainer | Hood Chatham |