It's likely because bsqr
is negative and taking the sqrt of a negative number doesn't work too well.
>>> import math
>>> math.sqrt(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: math domain error
Check your algebra/inputs. c
(the hypoteneuse) should always be bigger than either of the legs (a
and b
)
Also, side note, you could also get a ZeroDivisionError
if you happen to put in values for a
and c
which are equal (after int
truncates them).