A distance measuring device includes a light emitter, a light detector, a
clamp that outputs long-range side signal or clamp signal, a calculator
that calculates the ratio between the short-range side signal and the
signal output from the clamp and outputs a ratio signal, a light meter
measuring the luminance of outside light, a threshold setter that sets up
an infinity determination threshold value such that a lower luminance of
the outside light corresponds to the longer range side as a threshold
value; a converter that, when the output ratio signal is the signal
corresponding to the short range side and is shorter than the infinity
determination threshold value, converts the output ratio signal into a
distance signal, and, if not, converts the output ratio signal into a
distance signal having a fixed value.