fork download
  1. local a = 2
  2. local b = 6
  3. local c = 4
  4. local x1
  5. do
  6. local a2 = 2 * a
  7. local d = math.sqrt(b ^ 2 - 4 * a * c)
  8. x1 = (-b + d) / a2
  9. x2 = (-b - d) / a2
  10. end
  11. print(x1, x2)
  12.  
  13. --https://pt.stackoverflow.com/q/325490/101
Success #stdin #stdout 0s 14112KB
stdin
Standard input is empty
stdout
-1.0	-2.0