Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
cdavid
on March 31, 2022
|
parent
|
context
|
favorite
| on:
How to compare floats in Python
relative tolerance is not always enough, especially near 0. This classic article gives a nice overview of absolute, relative, ulp-based and other methods for comparison of float numbers:
https://randomascii.wordpress.com/2012/02/25/comparing-float...
Tainnor
on March 31, 2022
[–]
> especially near 0
Yes, these are denormalised numbers. They aren't as well behaved.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: