# Why are my dimension calculations so far off?

I've got some macros storing information about various dimensions. When I start dividing by dimensions, though, I'm getting answers that don't make sense.

\documentclass{article}
\usepackage[landscape]{geometry}
\makeatletter
\def\aetopmargin{0.85in}%%
\def\aebotmargin{0.5in}%%
\def\aeworkspacetopsep{4ex}
\def\aeworkspacerulesep{0.65cm}
\edef\aeworkspaceheight{\dimexpr\paperheight-\aeworkspacetopsep-\aetopmargin-\aebotmargin}
\typeout{==>Work space height===>\strip@pt\dimexpr\aeworkspaceheight}
\typeout{==>Work space rule: ===>\strip@pt\dimexpr\aeworkspacerulesep}
\typeout{==>Their quotient is===>\strip@pt\dimexpr \dimexpr\aeworkspaceheight\relax / \dimexpr\aeworkspacerulesep\relax \relax}
\makeatother
\pagestyle{empty}
\begin{document}
empty
\end{document}


When I run this I get the following output on the terminal:

==>Work space height===>499.5079
==>Work space rule: ===>18.49411
==>Their quotient is===>0.00041


Shouldn't I be getting something more like

==>Their quotient is===>27.00902...

-
Nevermind now I got what you mean. Sorry – percusse Apr 10 '14 at 20:28
rather than defining a macro, try using \newdimen\xxx \setdimen\xxx0.85in etc. – barbara beeton Apr 10 '14 at 20:29
@barbarabeeton I could do that, but it's actually easier for the current document if I don't have to work with dimensions for these values. On the surface, I'm sure that sounds absurd. But I designed the document around the macros because for the most part I'm actually not using these as dimensions. – A.Ellett Apr 10 '14 at 20:32
pgfmath reports the correct values so it must be an ambiguous interpretation of etex – percusse Apr 10 '14 at 20:34
It needs parenthesis around them to your previous comment :) – percusse Apr 10 '14 at 20:41

You can only divide by a length number , returning a length using etex / you can not divide two lengths to get a number. So if you divide by a length it is cast to a number by taking the length as an integer number of sp that number is a lot bigger than you intended, so the quotient is rather small.
@A.Ellett in his example \dimexpr 1pt * \ht\mybox / \textheight\relax he introduces the 2^16 sp scale factor on top and bottom of the quotient a *\ht\mybox takes the height in sp as a number and / \textheight takes \textheight in sp so it cancels out, but you only had one sp length. – David Carlisle Apr 10 '14 at 21:50