Closed
Description
fuzzy_eq()
is well working with small float numbers but when the number become too large that even the round-off error exceed the epsilon(default is 1e-6), the function can return an unexpected result.
See this
https://gist.github.com/ILyoan/5136141
fuzzy_eq()
in 21th line will return false
because
27272727272727276822 = 1e20 * (1/11) * 3
27272727272727272406 = 1e20 * (3/11)
and the difference between two numbers is larger than default epsilon
How about we use relative error method like this
https://gist.github.com/ILyoan/5136153
Metadata
Metadata
Assignees
Labels
No labels