STINNER Victor <vstin...@python.org> added the comment:
I compare nanoseconds (int): >>> t=1580301619906185300 # int/int: int.__truediv__(int) >>> abs(t - int(t/10**9 * 1e9)) 172 # int/float: float.__rtruediv__(int) >>> abs(t - int(t/1e9 * 1e9)) 84 # float/int: float.__truediv__(int) >>> abs(t - int(float(t)/10**9 * 1e9)) 84 # float/float: float.__truediv__(float) >>> abs(t - int(float(t)/1e9 * 1e9)) 84 => int/int is less accurate than float/float for t=1580301619906185300 You compare seconds (float/Fraction): >>> from fractions import Fraction as F >>> t=1580301619906185300 # int / int >>> float(F(t/10**9) * 10**9 - t) 88.5650634765625 # int / float >>> float(F(t/1e9) * 10**9 - t) -149.853515625 => here int/int looks more accurate than int/float And we get different conclusion :-) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39484> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com