I would like to ask how we can define a and b are actually same after approximation. I like to have True in the following case.
a = 59.9999999
b = 60.0000001
if (a==b):
print(True)
else:
print(False)
Answer
a = 59.9999999
b = 60.0000001
np.isclose([a],[b],atol =a-b)
#op
array([ True])
No comments:
Post a Comment