I am trying to create mental math worksheets that extend math facts from 6*7=___ to something like 6*700000=_________.
Apparently, though PGF and/or TeX cannot handle numbers bigger than around 16000. [I find this bizarre; it strikes me as the kind of problem a computer programmer might have run into in 1953.]
What is the easiest fix for this?
I've found two related threads (link 1, link 2). I'm wondering if I should:
- Stick to those threads and start fiddling around with
\ifnumcounters,\exp13, and\fpeval, etc. [no idea what these are]. The explanations in the thread were a little jargon-rich for me, but I can handle it. It would take a while, but it's how I've learned a lot ofLaTeX,TikZ, andPGFso far. - Find another resource to tell me what those commands do.
- Search for some easier third way to program worksheets to handle these (fairly trivial) calculations.
Thanks!
This code does not compile when \PowerOfTen becomes so big that other numbers exceed ~16000.
\documentclass{article}
\usepackage{pgf}
\pgfmathsetseed{\number\pdfrandomseed}
\newcommand{\InitVariables}
{\pgfmathrandominteger{\FactorA}{1}{10}
\pgfmathdeclarerandomlist{PowerOfTen}{{1}{10}{100}{1000}{10000}}
\pgfmathrandomitem{\PowerOfTen}{PowerOfTen}
\xdef\PowerOfTen{\PowerOfTen}
\pgfmathrandominteger{\FactorBInteger}{1}{10}
\pgfmathsetmacro{\FactorB}{int(\FactorBInteger*\PowerOfTen)}
\pgfmathsetmacro{\Product}{int(\FactorA*\FactorB)}
}
\setlength{\parindent}{0cm}
\begin{document}
\section*{Scaled Up Times Tables Exercises}
\InitVariables
FactorA = \FactorA
FactorBInteger= \FactorBInteger
PowerOfTen = \PowerOfTen
FactorB = \FactorB
FactorA x FactorB = Product
\(\FactorA\times\FactorB=\Product\)
\end{document}

xloppackage allows you to do this https://ctan.org/pkg/xlop – AndréC Dec 28 '17 at 08:18