title: Quadratic Equation Solver in JavaScript
body: <p>For some reason, when a=1, b=1, c=-1, I am not getting the desired result of -1.6180339887499 and 0.61803398874989. Instead, I get 2 and 1. What am I doing wrong?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function solve(a,b,c){
      var result = (((-1*b) + Math.sqrt(Math.pow(b,2)) - (4*a*c))/(2*a));
      var result2 = (((-1*b) - Math.sqrt(Math.pow(b,2)) - (4*a*c))/(2*a));
      
      return result + "&lt;br&gt;" + result2;
  }
  
  document.write( solve(1,1,-1) );</code></pre>
  </div>
  </div>
  </p>