CTAN Comprehensive TeX Archive Network

Direc­tory macros/latex/contrib/longdivision

README.md

long­di­vi­sion v1.1.0

Author: Hood Chatham Email: hood@mit.edu Date: 2019-03-24 De­scrip­tion: Li­cense: All files have the La­tex Project Public Li­cense. Files: long­di­vi­sion.sty long­di­vi­sionman­ual.tex long­di­vi­sionman­ual.pdf README.md

Does the long di­vi­sion al­go­rithm and type­sets the re­sults. The div­i­dend must be a pos­i­tive dec­i­mal num­ber and the di­vi­sor must be a pos­i­tive in­te­ger. Cor­rectly han­dles re­peat­ing dec­i­mals, putting a bar over the re­peated part of the dec­i­mal. Han­dles div­i­dends up to 20 dig­its long grace­fully (though the type­set re­sult will take up about a page) and div­i­dends be­tween 20 and 60 dig­its long slightly less grace­fully.

De­fines macros long­di­vi­sion and int­long­di­vi­sion. Each takes two ar­gu­ments, a div­i­dend and di­vi­sor. long­di­vi­sion keeps di­vid­ing un­til the re­main­der is zero, or it en­coun­ters a re­peated re­main­der. long­di­vi­sion stops when the div­i­dend stops (though the div­i­dend doesn't have to be an in­te­ger).

int­long­di­vi­sion be­haves sim­i­larly to the long­div com­mand de­fined in long­div.tex, though I think int­long­di­vi­sion looks bet­ter, and it can han­dle much larger div­i­dends and di­vi­sors (the div­i­dend is only con­strained by the size of the page, and the di­vi­sor can be up to 8 dig­its long).

See the pack­age man­ual for more in­for­ma­tion.

Email me at hood@mit.edu to sub­mit bug re­ports, re­quest new fea­tures, etc. The cur­rent de­vel­op­ment copy is hosted at https://github.com/hood­mane/long­di­vi­sion.

Changelog:

1.1.0

Fixed:

  • If the "long­di­vi­sion" com­mand is in math mode, the num­bers are type­set in math mode too (re­ported by Yu-Tsiang Tai).
  • The "long­di­vi­sion" com­mand now can han­dle macros as ar­gu­ments (as sug­gested by Mike Jenck).

Added:

  • Mul­ti­ple type­set­ting styles
  • Mul­ti­ple styles for in­di­cat­ing a re­peat­ing dec­i­mal
  • Type­set­ting par­tial long di­vi­sion (as sug­gested by Cameron McLe­man).

1.0.0

Down­load the con­tents of this pack­age in one zip archive (130.1k).

long­di­vi­sion – Type­sets long di­vi­sion

This pack­age ex­e­cutes the long di­vi­sion al­go­rithm and type­sets the so­lu­tions. The div­i­dend must be a pos­i­tive dec­i­mal num­ber and the di­vi­sor must be a pos­i­tive in­te­ger. Re­peat­ing dec­i­mals is han­dled cor­rectly, putting a bar over the re­peated part of the dec­i­mal. Div­i­dends up to 20 dig­its long are han­dled grace­fully (though the type­set re­sult will take up about a page), and div­i­dends be­tween 20 and 60 dig­its long slightly less grace­fully.

The pack­age de­fines two macros, \long­di­vi­sion and \int­long­di­vi­sion. Each takes two ar­gu­ments, a div­i­dend and a di­vi­sor. \long­di­vi­sion keeps di­vid­ing un­til the re­main­der is zero, or it en­coun­ters a re­peated re­main­der. \int­long­di­vi­sion stops when the div­i­dend stops (though the div­i­dend doesn't have to be an in­te­ger).

This pack­age de­pends on the xparse pack­age from the l3­pack­ages bun­dle.

Pack­agelong­di­vi­sion
Re­pos­i­toryhttps://github.com/hood­mane/long­di­vi­sion
Ver­sion1.1.0 2019-03-24
Li­censesThe Project Public Li­cense
Copy­right2017–2019 Hood Chatham
Main­tainerHood Chatham
Con­tained inTeX Live as long­di­vi­sion
MiKTeX as long­di­vi­sion
TopicsArith­metic
Maths
See alsolongdiv
...
Guest Book Sitemap Contact Contact Author