STINNER Victor <victor.stin...@gmail.com> added the comment:

> So NaN is a possible result from time.time()?

Oops. I don't know if it is possible. I just know that it cannot return None :-)

_PyTime_gettimeofday() fills a structure having two integer fields (tv_sec, 
tv_usec), and floattime() uses these fields to compute a double:

static PyObject*
floattime(void)
{
    _PyTime_timeval t;
    _PyTime_gettimeofday(&t);
    return PyFloat_FromDouble((double)t.tv_sec + t.tv_usec * 1e-6);
}

I don't see how "(double)t.tv_sec + t.tv_usec * 1e-6" can generate NaN.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14613>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to