0.6 * 0.7
0.42
(0.6+1)*(0.7+1)
2.72
((0.6+1)*(0.7+1)) - 1
1.7200000000000002
((0.6+1)*(0.7+1)) - 1 - (0.6 * 0.7)
1.3000000000000003
((0.6+1)*(0.7+1)) - 1 - (0.6 * 0.7) - 0.6
0.7000000000000003
((0.6+1)*(0.7+1)) - 1 - (0.6 * 0.7) - 0.6 == 0.7
False
import numpy as np
print(np.allclose(((0.6+1)*(0.7+1)) - 1 - (0.6 * 0.7) - 0.6, 0.7))
True
def an_oddity(a, b):
output = ((a+1)*(b+1)) - 1 - (a*b) - a
#print(output)
return np.allclose(output, b)
an_oddity(0.6, 0.7)
True
an_oddity(0.8, 0.9)
True
an_oddity(0.2, 0.9)
True
all((an_oddity(a,b) for (a,b) in np.random.randn(1000, 2)))
True