I response to xport's recent questions, I tried to do the following
\usepackage{pgf}
[...]
\rule{\pgfmathdivide{4}{3}\pgfmathresult mm}{5mm}
Unfortunately, this fails with the following error message:
! Missing number, treated as zero.
<to be read again>
\begingroup
l.11 ...pgfmathdivide{4}{3}\pgfmathresult mm}{5mm}
My first guess was that for some reason the output of \pgfmathresult cannot be used as the input for \rule. However, the slight rearrangement
\pgfmathdivide{4}{3}\rule{\pgfmathresult mm}{5mm}
works as expected. Why? What do I have to change to be able to put \pgfmathdivide inside the argument of \rule (or rather inside a macro that can be used in the argument of \rule and similar commands)?