I described how TeX inputs dimensions and handles units in https://tex.stackexchange.com/a/231281 and Why pdf file cannot be reproduced? and possibly at other locations, including some comments which are not always read.
I am using Plain TeX but of course it works exactly the same in LaTeX.
\ifdim\testA = \testB
The two dimensions are equal
The two dimensions are not equal
One needs 17 fractional digits to be certain that the dimension stabilizes (of course you get only 1sp possible difference after 5 fractional digits, because
1/10^5 < 1/65536, here in this example where one multiplies
1pt). And some things are counterintuitive, for example
0.33333 is enough but
0.22222 is not although it looks closer to
0.33333 was to
It goes without saying that Knuth has programmed it exactly to fetch 17 fractional digits and not one more, because the theorem is that it will never change after that.
As another random example consider this
0.824440003 gives distinct result from
We can confirm this also in a rôle as
\verb|0.82444\linewidth| gives \the\mylength.
\verb|0.824440003\linewidth| gives \the\mylength.
These two things differ!
I hope this will dispel some misunderstandings\\
about ``five fractional digits suffice''. Wrong.
Notice that above
0.000000003\linewidth is in truth
0.00000125476104pt well below the TeX "error".
THE DIFFERENCE IS AMPLIFIED BY A FACTOR GREATER THAN 5000 !
As per the actual question, here is my comment
the most precise way to multiply by a fraction is \dimexpr\numexpr A*<dimen>/B sp\relax (where <dimen> is like \linewidth but not 10pt then use \dimexpr10pt\relax in place of <dimen>)