📌  相关文章
📜  python 检查浮点数的相等性 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:29.983000             🧑  作者: Mango

代码示例1
# credit to the Stack Overflow user in the source link
# method of the 'math' module

def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
    return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)