2. If real numbers $x, y$ make three of the four numbers $x+y, x-y, xy, \frac{x}{y}$ equal, then the value of $|y|-|x|$ is ( ).
(A) $-\frac{1}{2}$
(B) 0
(C) $\frac{1}{2}$
(D) $\frac{3}{2}$
2.C.

Obviously, $x+y \neq x-y$, otherwise, $y=0$, at this time, $\frac{x}{y}$ is undefined. Therefore, it must be that $x y=\frac{x}{y}$. Thus, we have
$$
x\left(y^{2}-1\right)=0 \text {. }
$$

Solving this, we get $x=0$ or $y= \pm 1$.
(1) When $x=0$, if $x y=x+y$ or $x y=x-y$, both lead to $y=0$, making $\frac{x}{y}$ undefined, so, $x \neq 0$.
(2) When $y=1$, if $x y=x+y$, we get $x=x+1$, which is not valid; if $x y=x-y$, we get $x=x-1$, which is also not valid. Therefore, $y \neq 1$.
(3) When $y=-1$, if $x y=x+y$, we have $-x=x-1$, yielding $x=\frac{1}{2}$; if $x y=x-y$, we have $-x=x+1$, yielding $x=-\frac{1}{2}$. Hence, when $y=-1$, there are solutions that satisfy the problem.
Thus, $|y|-|x|=1-\frac{1}{2}=\frac{1}{2}$.