[SciPy-user] random number

Steve Schmerler elcorto at gmx.net
Tue Jun 29 09:23:27 EDT 2004


> When running the example, I didn't get any errors. I'm running Pythonwin
> with Python 2.3.2 and scipy 0.3 
> 
> >>> from scipy.stats.rand import *
> >>> x=uniform(0,1e38)[0]
> >>> x
> 5.9481523519433107e+037
> >>> uniform(0,1e38)[0]
> 7.5203911045864378e+037
> >>>

sure, 1e38 works also on my machine

    >>> uniform(0,1e38)[0]
    7.6608738834125681e+037

but 1e39 doesn't

    >>> uniform(0,1e39)[0]
    1.#INF

> 
> But if you change the seed, e.g 
> >>> uniform(0,1e38)[1]
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
> IndexError: index out of bounds 

This is seed changing? Since 'uniform' gives an array like this

    >>> uniform(0,1e38)
    array([ 5.15205248e+037])  

the call

    >>> uniform(0,1e38)[1]

is truly out of bound.

bye

-- 
"Documentation is like sex: when it's good,
it is very, very good; and when it's bad, it
is better than nothing." -- Dick Brandon
--

"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info




More information about the SciPy-User mailing list