[issue39484] time_ns() and time() cannot be compared on windows

Larry Hastings report at bugs.python.org
Mon Feb 3 09:28:55 EST 2020


Larry Hastings <larry at hastings.org> added the comment:

> The problem is that there is a double rounding in
>     time = float(time_ns) / 1e9
> 1. When convert time_ns to float.
> 2. When divide it by 1e9.

I'm pretty sure that in Python 3, if you say
   c = a / b
and a and b are both "single-digit" integers, it first converts them both into doubles and then performs the divide.  See long_true_divide() in Objects/longobject.c, starting (currently) at line 3938.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39484>
_______________________________________


More information about the Python-bugs-list mailing list