[Python-checkins] python/nondist/sandbox/twister test_random.py,1.3,1.4
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sat, 28 Dec 2002 23:03:17 -0800
Update of /cvsroot/python/python/nondist/sandbox/twister
In directory sc8-pr-cvs1:/tmp/cvs-serv24159
Modified Files:
test_random.py
Log Message:
'##' is the Emacs pymode convention for commented-out code blocks. Don't
use it for ordinary comments.
Index: test_random.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/twister/test_random.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_random.py 29 Dec 2002 02:15:56 -0000 1.3
--- test_random.py 29 Dec 2002 07:03:15 -0000 1.4
***************
*** 8,12 ****
class TestBasicOps(unittest.TestCase):
! ## Superclass with tests common to all generators
def randomlist(self, n):
--- 8,12 ----
class TestBasicOps(unittest.TestCase):
! # Superclass with tests common to all generators
def randomlist(self, n):
***************
*** 81,98 ****
def test_referenceImplementation(self):
! ## Compare the python implementation with results from the original
! ## code. Create 2000 53-bit precision random floats. Compare only
! ## the last ten entries to show that the independent implementations
! ## are tracking. Here is the main() function needed to create the
! ## list of expected random numbers:
! ## void main(void){
! ## int i;
! ## unsigned long init[4]={61731, 24903, 614, 42143}, length=4;
! ## init_by_array(init, length);
! ## for (i=0; i<2000; i++) {
! ## printf("%.15f ", genrand_res53());
! ## if (i%5==4) printf("\n");
! ## }
! ## }
expected = [0.458398030737133, 0.860578152019788, 0.928483317267822,
0.359326811197825, 0.081823493762450, 0.143322264701693,
--- 81,98 ----
def test_referenceImplementation(self):
! # Compare the python implementation with results from the original
! # code. Create 2000 53-bit precision random floats. Compare only
! # the last ten entries to show that the independent implementations
! # are tracking. Here is the main() function needed to create the
! # list of expected random numbers:
! # void main(void){
! # int i;
! # unsigned long init[4]={61731, 24903, 614, 42143}, length=4;
! # init_by_array(init, length);
! # for (i=0; i<2000; i++) {
! # printf("%.15f ", genrand_res53());
! # if (i%5==4) printf("\n");
! # }
! # }
expected = [0.458398030737133, 0.860578152019788, 0.928483317267822,
0.359326811197825, 0.081823493762450, 0.143322264701693,