In some book I found, a metric on a non-empty set $X$ defined as a map $$X\times X\to \Bbb R^{+}$$ and some other place as $$X\times X\to \Bbb R$$ So, is a metric a real valued function or a non-negative real valued function or it doesn't matter at all?
Since metric is a generalization of distance on the real line. I was convinced by the first definition. But the second one? I don't know and the worst part is, it is widely used definition.
If you write $X \times X \to \Bbb R^+$, you don't need to note that $d(x,y) \geq 0$ for all $x,y$, since it is already implied by the use of $\Bbb R^+$. If you write only $X \times X \to \Bbb R$, you must call the attention to this fact.