title: Solving Quadratic Formula
body: <p>I'm writing a program to solve quadratic equations using the quadratic formula but it only works when a = 1 but i want it to work when a is more than 1 </p>
  
  <p>Here is my code:</p>
  
  <pre><code>import math
  
  def solve(a, b, c):
  
      x = ((-1)* b + math.sqrt(b**2-4*a*c))/2*a
      print "x = %s" %x
      print "or"
      y = ((-1)* b - math.sqrt(b**2-4*a*c))/2*a
      print "x = %s" %x
  
  
  
  
  while 1:
      a = int(raw_input("Enter A :"))
      b = int(raw_input("Enter B :"))
      c = int(raw_input("Enter C :")) 
      solve(a, b, c)
  </code></pre>
  
  <p>It works with 1 but when I use a number more than one when i use say 4 i get this error</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Documents and Settings\User\Desktop\Factor.py", line 18, in &lt;module&gt;
      solve(a, b, c)
    File "C:\Documents and Settings\User\Desktop\Factor.py", line 5, in solve
      x = ((-1)* b + math.sqrt(b**2-4*a*c))/2*a
  ValueError: math domain error
  </code></pre>
  
  <p>is there a way around this if so help!!</p>