[SciPy-User] how to generate very small random number

franck kalala franckkalala@googlemail....
Wed Nov 16 04:57:28 CST 2011


Hello Folk

I would like to generate very small random number in scipy.

the command  random()  generate random number in  (0,1).

I am doing a simulation that involve very small numbers.

for example I am doing somthing like this:

>>> import random
>>> a = random.random()
>>> if a < 10**-6:
          do something

But the 'do domething' is never executed,  because   10**-6 is very small,
and in many cases  the random number generate is large,

I would like then to generate very small number of order  of  10**-6 for
example,

Any idea on how to do that?

Cheers

F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20111116/211d9f8d/attachment-0001.html 


More information about the SciPy-User mailing list