In geometry, points $P$ and $Q$ are said to be the harmonic conjugate with respect to points $A$ and $B$ if they divide $AB$ internally and externally in the same ratio.
One of my books specifies the formula $$\frac{2}{AB} =\frac{1} {AP}+ \frac{1} {AQ}.$$ Trying to derive this, you see that there are three cases; one for $P$ and two for $Q$ depending on which of $A$ or $B$ it's closer to. This formula works out if you consider the case when $Q$ is closer to $B$, but not in the other case.
Is it just that the formula is derived with $A$ being defined as the point $Q$ is farther from in the case of external division, and they just left it out? That's the only way it makes sense, unless the book's talking about signed distance, which I don't think is the case here.
So consider the case where $Q$ is closer to $A$ than $B$.
Suppose $A=(0,0), B=(x,0), P=(p,0), Q=(q,0)$. Here $x,p$ are positive but $q$ is negative.
The definition of harmonic conjugates says that $$\frac{AP}{PB}=\frac{AQ}{BQ}$$ that is $$\frac{p}{x-p}=\frac{-q}{x-q}$$ $$\Rightarrow \frac{1}{p}+\frac{1}{q}=\frac{2}{x}$$
One can conclude that the book is indeed using the signed lengths.