def test_is_close():
''' just to make sure '''
assert isclose(4.5, 4.5)
assert isclose(4.5, 4.499999999999999999)
assert not isclose(4.5, 4.6)
# of course, not comprehesive!
# you need to compute a bunch of evenly spaced numbers from a to b
# kind of like range() but for floating point numbers
# I did it as a separate function so I could test it
评论列表
文章目录