Solving the linear equation

The linear equation is an equation of polynomial degree 1. Via simple changing of subject of the formula, we get:

(1)
\begin{align} ax+b=0 \\ x=-\frac{b}{a} \end{align}
function solvelinear(a,b) {
return -(b/a);
}