提交 b3d0a8b2 authored 作者: Frederic Bastien's avatar Frederic Bastien

Try to be even more overflow tolerent.

上级 1aed0987
...@@ -203,7 +203,7 @@ class Scalar(Type): ...@@ -203,7 +203,7 @@ class Scalar(Type):
diff = a - b diff = a - b
if diff == 0: if diff == 0:
return True return True
return abs(diff) <= ((abs(a) + abs(b)) * tolerance) return abs(diff) <= (abs(a) * tolerance) + (abs(b) * tolerance)
def c_headers(self, c_compiler): def c_headers(self, c_compiler):
l = ['<math.h>'] l = ['<math.h>']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论