See the implementation of Python's math.isclose
https://github.com/python/cpython/blob/d61fcf834d197f0113a6a...