factorials up to 12 are handled.How can make it to compute beyond that?
Error: “Arithmetic overflow
\documentclass{article}
\begin{document}
\newcount\n \newcount\p \newcount\m
\def\factorial#1{{\m=#1\advance\m by 1
\n=1
\p=1
\loop\ifnum\n<\m \multiply\p by \n \advance\n by 1 \repeat\number\p}}
\def\printfactorials#1{\m=#1\advance\m by 1
\n=0
\loop\ifnum\n<\m \hfil\break\number\n! = \factorial{\n} \advance\n by 1 \repeat}
\printfactorials{12}
\end{document}
Best Answer
Using
bigintcalc
(from theoberdiek
bundle), you can obtain the following output:\bigintcalcXXX
is the basic operators that are defined.\bigintcalcFac{<x>}
returns the factorial of<x>
. According to thebigintcalc
documentation,