[Tutor] multithreading random()

John Fouhy john at fouhy.net
Tue Oct 10 06:51:09 CEST 2006


On 10/10/06, Dick Moores <rdm at rcblue.com> wrote:
> And another question. That page also says, "Almost all module
> functions depend on the basic function random(), which generates a
> random float uniformly in the semi-open range [0.0, 1.0). Python uses
> the Mersenne Twister as the core generator. It produces 53-bit
> precision floats and has a period of 2**19937-1." What is a 53-bit
> precision float? Would that be something like a float accurate to 8
> or 9 figures (dividing 53 by 8). Or what?

Hi Dick,

Have a look here: http://en.wikipedia.org/wiki/Double_precision
and here: http://en.wikipedia.org/wiki/IEEE_floating-point_standard

Basically, floating point numbers are of the form "x times 2**y",
where x is a binary number between 1 and 10 (that's binary 10, decimal
2).  53 bits means 53 binary digits of precision (including the
initial 1).

Does that help?

-- 
John.


More information about the Tutor mailing list