title: Value Error: math domain error in Python
body: <p>I'm writing a code to help me solve the Pythagorean theorem in Python. Problem is, I keep getting this one error when I have the code try solving for B.</p>
  
  <p>This is the bit that always gives me problems:</p>
  
  <pre><code>bsqr = (int(c) ** 2) - (int(a) ** 2)
  b = int(bsqr) / sqrt(bsqr)
  </code></pre>
  
  <p>I get this error: </p>
  
  <pre><code> Traceback (most recent call last):
   File "&lt;pyshell#24&gt;", line 1, in &lt;module&gt; pythag()
   File "C:\Python34\fact.py", line 156, in pythag
   b = int(bsqr) / sqrt(bsqr)
   ValueError: math domain error
  </code></pre>
  
  <p>What is causing this error, and how can I fix it?</p>