Is there any way to store real numbers (e.g. 4.5) as variable / macro / counter / whatever in standard LaTeX (no direct Lua code) and perform the 4 basic mathematical operations with them? I need to be able to store such numbers and perform repeated calculations on them, at different points in my code (not just once).
I've considered storing the numbers as lengths (say multiplied by 100pt) but I am stuck at recovering the underlying numbers (to actually use them to multiply other lengths...).
Bonus point if you minimize the number of external packages required. As for everything TeX, I am pretty sure someone will come up with a way to do this with tikz :)
ptis probably 'lowest' cost (no packages). On the other hand, clearer solutions involving eitherfp,pgfmathor the expandablel3fpare all also available. – Joseph Wright Feb 06 '13 at 08:58pgf/tikzanswer :) – Xavier Feb 06 '13 at 09:28\realand\ratiomacros of thecalcpackage. – Xavier Feb 07 '13 at 19:31