From dea1f720db1da7dba1cf248660fc9e79d6b2d404 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 10 Aug 2007 03:17:55 +0000 Subject: [PATCH] Fix first part of bug #18982. Thanks to John Darrington for finding the problem and verifying the fix. --- tests/formats/num-in.expected.gz | Bin 9536 -> 9745 bytes tests/formats/num-in.sh | 46 ++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/tests/formats/num-in.expected.gz b/tests/formats/num-in.expected.gz index 51e9fff37c70eb8fb0281384011f4fe7ab7d4dbc..40a617d6dcd80bf1284d376060568b4d6e3a90f7 100644 GIT binary patch literal 9745 zcmYLPX+VR3wFv7>*Rk^FpmqU|C5t-)tGhkEDi)aNnJ*8W*({T&$- zcRh3T@;>j7%g-0)uT`(NBER`!vGeLbpD1-I5-=#UZYTA?twN*9db^dTF;DF*LWoDl ziKt^LVQVwq-2<7m#F%8A-l_3#qGNZbG^6*6$E9b9_x;r7Dbbt=5T2`x(h_-%Q`&o= zTO7KoKdY#%lm5#$GMzu6iHMBeQ$ye>x1&`+jZk2UmJJK^81y>9OzuDZ#!Q((@LJK8 zJ+xNk0=kyyv~NtV zT?AfFc%SWA4(xZvdAxg|EOhCIuf+oj3=~%p?pYflyz7p{ko1-MHRlowdCZqm#C{_D zk*n>Rkz&kZ|1{q*148UU;`Q*w8`CAf!Ds>{Muq~*P?$xk4HOo-r|nxLx=4iotfWp@ zoH6diZ0p?5xK;3yDLorX-Wey+{7Nkd*j8EYDVx_HNYJtH>ja(q^>_Mp@hybcT$!%C zZCF4kv~6=gwMf){2D_{>o=t6J)_d4e*1L|W{g?~MBN{i9ItYY*`ymEs<;Uu(-1EI)NM^winMt1d1z?$q~1p-9-@xdQWo1hG*j5hrILTdZ_;6J19j6IKV#^@jvrKC|wgnQ5>0( zW%RefQ1XaxO%Oxnh@5BMv88oC^CAKct%u>cbW=@9M%Q+9oTwleX%<^B8XG>K@lQjPGP=_qN1?Rz#&KX%+9{|bqY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L&9^LuopV@47!jWISX=kNPXBeA>^Q}6ueVG?`win&%5ni^@PNHTn(11y z?ins`YW`|s04neHr#ikd ziVHSW0tQ2r^IMC@G&F~|#SFlFr%m$9iwm+jy0HU?Lb}y^h8zd}QwLk}Ll03+-e!X( z%M>;rPDE{Jk@}n|+!mvLv{nh?hR%`J*Ow{YQqyuL4K zbeArNBBbX#?$;@uZ;d8jTfWocXbF~i$6ygR3s#4r;Bly6r1bNvuy8@OEI7?Iy|Y2*E*jmZx7%n#od{4RxqCjYDNJ>^t+ zk0u~moDUmILVkF0!h4UG#rE;7 N(wlSH+JAoZ{{YJd$CUs8 diff --git a/tests/formats/num-in.sh b/tests/formats/num-in.sh index 49ba6b53..e58af758 100755 --- a/tests/formats/num-in.sh +++ b/tests/formats/num-in.sh @@ -38,6 +38,44 @@ pass() cd $TEMPDIR +activity="write PRNG fragment" +cat > my-rand.pl <<'EOF' +# This random number generator and the test for it below are drawn +# from Park and Miller, "Random Number Generators: Good Ones are Hard +# to Come By", Communications of the ACM 31:10 (October 1988). It is +# documented to function properly on systems with a 46-bit or longer +# real significand, which includes systems that have 64-bit IEEE reals +# (with 53-bit significand). The test should catch any systems for +# which this is not true, in any case. + +our ($seed) = 1; +sub my_rand { + my ($modulo) = @_; + my ($a) = 16807; + my ($m) = 2147483647; + my ($tmp) = $a * $seed; + $seed = $tmp - $m * int ($tmp / $m); + return $seed % $modulo; +} +EOF +if [ $? -ne 0 ] ; then no_result ; fi + +activity="write PRNG test program" +cat > test-my-rand.pl <<'EOF' +#! /usr/bin/perl +use strict; +use warnings; +do 'my-rand.pl'; +my_rand (1) foreach 1...10000; +our $seed; +die $seed if $seed != 1043618065; +EOF +if [ $? -ne 0 ] ; then no_result ; fi + +activity="test PRNG" +$PERL test-my-rand.pl +if [ $? -ne 0 ] ; then no_result ; fi + activity="write Perl program" cat > num-in.pl <<'EOF' #! /usr/bin/perl @@ -46,7 +84,7 @@ use POSIX; use strict; use warnings; -our $next = 0; +do 'my-rand.pl'; for my $number (0, 1, .5, .015625, 123) { my ($base_exp) = floor ($number ? log10 ($number) : 0); @@ -135,12 +173,6 @@ sub permute_spaces { sub pick { return $_[int (my_rand ($#_ + 1))]; } - -sub my_rand { - my ($modulo) = @_; - $next = ($next * 1103515245 + 12345) % (2**32); - return int ($next / 65536) % $modulo; -} EOF activity="generate data" -- 2.30.2