[Numpy-discussion] [Q] RandomArray module has a problem ????

newton at ns.kias.re.kr newton at ns.kias.re.kr
Tue Mar 5 17:51:14 CST 2002


Hi,
 
RandomArray has a problem?
 
I use python2.0, Numpy 20.3.
 
simple source code is ...
--------------------------------
#!/usr/bin/env python
import math
import Numeric
import RandomArray
import sys
 
RandomArray.seed(1234,5678)
i=0L
while 1:
    i = i+1
    a = RandomArray.randint(0,100)
    if a==100:
        print 'i=',i, 'a=',a
 
---------------------------------
 
and result is
---------------------------------
i= 70164640 a= 100
i= 152242967 a= 100
i= 159619195 a= 100
i= 173219763 a= 100
i= 200933959 a= 100
i= 233219191 a= 100
i= 276114822 a= 100
i= 313589319 a= 100
i= 340689813 a= 100
i= 402397265 a= 100
i= 456099215 a= 100
i= 506078935 a= 100
i= 547758957 a= 100
i= 559163554 a= 100
i= 570211180 a= 100
..........
---------------------------------
RandomArray.randint(0,100) has range 
0<= RandomArray.randint(0,100) <100.
But, result is not...somtime, a==100 arise.
 
So, I upgrade to python 2.2 and Numpy 21b3.
But, I met same problem.
And, so, I change the os Mandrake 8.0 to Redhat 7.2.
But, same problem...
 
I don't know what is my mistake...
 
Please help me ...
 
                    Kee-Hyoung Joo
 

------------------------------------------------------------------
I love Jesus Christ who is my savior. He gives me meanning of life.
In Christ, I have become shepherd and bible teacher.
 
e-mail : newton at kias.re.kr
home   : http://newton.skku.ac.kr/~newton (My old home page)
 
------------------------------------------------------------------






More information about the Numpy-discussion mailing list