We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My concern is that we're comparing 2 (possible) floats using the "==" operator. This can produce subtle bugs if the numbers are very close together.
I thing the recommended comparison is much more verbose:
Nested Lists
You are viewing a single comment's thread. Return to all comments →
My concern is that we're comparing 2 (possible) floats using the "==" operator. This can produce subtle bugs if the numbers are very close together.
I thing the recommended comparison is much more verbose:
See: [https://stackoverflow.com/questions/5595425/what-is-the-best-way-to-compare-floats-for-almost-equality-in-python])