As background, I was trying to write a macro that divides a page into columns given just a decimal scale factor. For example, given an input of .7 it should create columns of width .7*\textwidth and .3*\textwidth. Basically, I want to calculate
It doesn't seem to be possible to use floating point values with \numexpr and \dimexpr, for example
\dimexpr\numexpr(1-#1)\textwidth. In this case there is a workaround, which is
\dimexpr\textwidth-#1\textwidth. But it's easy to see how this would not work for more complex calculations.
Is there a way to do his using only (e)(La)TeX features? If not, what is the best alternative? Floating point calculations in LaTeX? gives some packages for floating point calculations but doesn't deal with lengths.