homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients gregory.p.smith, mark.dickinson, rhettinger, tim.peters
Date 2012年02月16日.11:09:07
SpamBayes Score 0.04315954
Marked as misclassified No
Message-id <1329390548.37.0.604561482879.issue14028@psf.upfronthosting.co.za>
In-reply-to
Content
The hypothesis that time.time() is returning NaN doesn't match the provided traceback. If time.time() had returned NaN, the exception would have happened earlier, on line 113 in random.py: long(time.time() * 256)
I'm wondering if the NaN arises in the C code for random():
random_random(RandomObject *self)
{
 unsigned long a=genrand_int32(self)>>5, b=genrand_int32(self)>>6;
 return PyFloat_FromDouble((a*67108864.0+b)*(1.0/9007199254740992.0));
}
Upstream from that, only integers are used, so this would be the earliest a NaN could arise when running the code in choice(): ``return seq[int(self.random() * len(seq))]``
History
Date User Action Args
2012年02月16日 11:09:08rhettingersetrecipients: + rhettinger, tim.peters, gregory.p.smith, mark.dickinson
2012年02月16日 11:09:08rhettingersetmessageid: <1329390548.37.0.604561482879.issue14028@psf.upfronthosting.co.za>
2012年02月16日 11:09:07rhettingerlinkissue14028 messages
2012年02月16日 11:09:07rhettingercreate

AltStyle によって変換されたページ (->オリジナル) /