Message158775
| Author |
vstinner |
| Recipients |
loewis, mark.dickinson, michael.foord, rye, vstinner |
| Date |
2012年04月19日.23:34:09 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334878450.3.0.366151236835.issue14613@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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. |
|
History
|
|---|
| 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 |
|