title: Getting 6.33 from an equation in Javascript when it should output 8.99
body: <p>I'm doing some simple math in Javascript, but my equation's result is drastically different than what it should be. The math is:</p>
  
  <pre><code>3.05+(((0.32*0)+3.28)+(1+(0.19*0))*(2.66*1^2))*1;
  </code></pre>
  
  <p>When I did it out by hand, and then used Wolfram Alpha (<a href="https://www.wolframalpha.com/" rel="nofollow noreferrer">https://www.wolframalpha.com/</a>) I get the correct result of 8.99. However, when I use the equation in Javascript I mysteriously get 6.33</p>
  
  <p>The actual equation looks like</p>
  
  <pre><code>VO2move = VO2rest+(((C1*g2)+VO2walkmin)+(1+(C2*g2))*(C3*s2^2))*t2;
  </code></pre>
  
  <p>but I removed all the variables in an attempt to debug (I thought it might be some error where I needed parseInt)</p>
  
  <p>Here are the whole functions for reference</p>
  
  <pre><code>function calc(){
      var temp = 0;
      var total = 0;
  
      for(i = 0; i&lt;sArr.length; i++){
          total = total + calc2(i);
      }
  
      var o = document.getElementById("output");
      o.value = total;
  }
  
  function calc2(i){
      var s = document.getElementById("s"+i);
      var g = document.getElementById("g"+i);
      var t = document.getElementById("t"+i);
      var VO2walkmin = 3.28; 
      var VO2rest = 3.05; 
      var C1 = 0.32;
      var C2 = 0.19;
      var C3 = 2.66;
      var Cdecline = 0.73;
      var s2 = s.value;
      var g2 = g.value;
      var t2 = t.value;
      var negGrade = g.value;
  
      if(g2 &lt; 0){g2 = 0};
  
      //VO2move = ((C1 * g2)+VO2walkmin)+((1+(C2*g2))*(C3*s2^2)); //ORIGINAL TRANSCRIPTION
  
      //VO2move = VO2rest+(((C1*g2)+VO2walkmin)+(1+(C2*g2))*(C3*s2^2))*t2; // TRANSLATED FROM COPY PASTE  
      VO2move = 3.05+(((0.32*0)+3.28)+(1+(0.19*0))*(2.66*1^2))*1; // COPY - PASTED FROM EXCEL
  
      return VO2move;
  }
  </code></pre>
  
  <p>Even naked numbers I still get the output of 6.33. I'm totally puzzled, and any help is appreciated.</p>