Commit adc0d783 authored by sumpfralle's avatar sumpfralle

handle "sqrt" for slightly negative values gracefully (discovered only on Windows)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@591 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 87f52f3b
......@@ -32,6 +32,9 @@ _use_precision = False
def sqrt(value):
# support precision libraries like "decimal" (built-in)
if -epsilon < value <= 0:
# compensate slightly negative values (due to float inaccuracies)
return 0
if hasattr(value, "sqrt"):
return value.sqrt()
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment