Message158775
> 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. |
|
Date |
User |
Action |
Args |
2012-04-19 23:34:10 | vstinner | set | recipients:
+ vstinner, loewis, mark.dickinson, michael.foord, rye |
2012-04-19 23:34:10 | vstinner | set | messageid: <1334878450.3.0.366151236835.issue14613@psf.upfronthosting.co.za> |
2012-04-19 23:34:09 | vstinner | link | issue14613 messages |
2012-04-19 23:34:09 | vstinner | create | |
|