i'm using tikzpicture and pgfplots to make my plots and i'm currently facing a problem when i use a function like 2/x
\begin{center}
\begin{tikzpicture}
\begin{axis}[ ymin=-10, ymax=10, xmin=-10, xmax=10, axis lines=middle, xlabel = $x$ , ylabel = $y$]
\addplot[dashed, color=red]{ (2)/(x) };
\end{axis}
\end{tikzpicture}
\end{center}
It gives me multiple errors like: dimension too large and arithmetic overflow, anyone knows how to fix it?