title: Inspired Lua Program is Different on Computer and Calculator
body: <p>I am attempting to create a simple quadratic formula program for my TI-Nspire CX CAS. I seem to have everything correct, and it works on the computer: <a href="https://i.stack.imgur.com/0bpYP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0bpYP.jpg" alt="enter image description here"></a></p>
  
  <p>However, it doesn't work on the calculator. I get the second one correct, but the 1st is -4.44089...e-16. (doesn't say ..., just using it because I don't want to type out the whole thing)</p>
  
  <p>The (simplified) code is as follows:</p>
  
  <pre><code>function quadraticA(f,s,t)
      return ((-1*s)+math.sqrt(s^2-4*f*t))/(2*f)
  end
  function quadraticB(f,s,t)
      return ((-1*s)-math.sqrt(s^2-4*f*t))/(2*f)
  end
  function on.paint(gc)
      formula:setExpression("0s: "..quadraticA(tonumber(a),tonumber(b),tonumber(c)))
      formulaB:setExpression(quadraticB(tonumber(a),tonumber(b),tonumber(c)))
  end
  </code></pre>
  
  <p>Why do I get a different answer on the calculator then on the computer? How can I fix the issue?</p>
  
  <p>Thanks in advance!</p>