I want to do the following arithmetic:
(x-y)*unit/s where x, y, s are rational constants and unit is in length unit.
\documentclass{article}
\usepackage{calc}
\newlength\unit
\unit=16pt
\def\x{0.5}
\def\y{0.3}
\def\s{0.8}
\newlength\temp
\begin{document}
\temp=\unit/\real{\s}*(\real{\x}-\real{\y})\relax
\the\temp
\end{document}
What is the easiest way to write dimensional expression?



includegraphics'viewport. – Click Me May 22 '12 at 14:32calcis able to do sums with floating point numbers. – egreg May 22 '12 at 14:34