Quantcast
Channel: Which is the fastest way to compare two float value in python? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Copperfield for Which is the fastest way to compare two float value...

you need to set a tolerance range, such that if the difference between a and b is bellow they are considered equals>>> def is_close(a, b, tol=1e-9): return abs(a-b) <= tol>>>...

View Article



Which is the fastest way to compare two float value in python?

I have two float value ("a" and "b") in Python 3 and each float value can have from 5 to 15 decimal point. The problem is that when two value are equal for me, python return me a False....

View Article
Browsing all 2 articles
Browse latest View live




Latest Images