mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
fix rand pseudo-random number generator
Fixed more documentation and code comments that referred to the old additive 55 (a55) shuffle pseudo-random number generator. We have been using the subtractive 100 shuffle pseudo-random number generator in place of the additive 55 generator for a while now.
This commit is contained in:
@@ -1130,7 +1130,7 @@ randbitrun.cal
|
||||
the number and length of identical bits runs match what is expected.
|
||||
By default, run_cnt is to test the next 65536 random values.
|
||||
|
||||
This tests the a55 generator.
|
||||
This tests the subtractive 100 shuffle pseudo-random number generator.
|
||||
|
||||
|
||||
randmprime.cal
|
||||
@@ -1177,7 +1177,7 @@ randrun.cal
|
||||
64 bit values. By default, run_cnt is to test the next 65536
|
||||
random values.
|
||||
|
||||
This tests the a55 generator.
|
||||
This tests the subtractive 100 shuffle pseudo-random number generator.
|
||||
|
||||
repeat.cal
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* randbitrun - check rand bit run lengths of the a55 generator
|
||||
* randbitrun - check rand bit run lengths of the subtractive 100 shuffle generator
|
||||
*
|
||||
* Copyright (C) 1999 Landon Curt Noll
|
||||
* Copyright (C) 1999,2023 Landon Curt Noll
|
||||
*
|
||||
* Calc is open software; you can redistribute it and/or modify it under
|
||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
|
@@ -1737,7 +1737,7 @@ print '024: parsed test_list()';
|
||||
/*
|
||||
* test 025: define test_rand for test 15dd
|
||||
*
|
||||
* This function tests the a55 shuffle pseudo-random number generator.
|
||||
* This function tests the subtractive 100 shuffle pseudo-random number generator.
|
||||
*/
|
||||
define test_rand()
|
||||
{
|
||||
@@ -3547,6 +3547,12 @@ define test_trig()
|
||||
vrfy(tnum++ == 3407, '3407: tnum == 3407');
|
||||
pi = pi(1e-20);
|
||||
|
||||
/* test trigonometric sine */
|
||||
vrfy(sin(0, 1e-10) == 0,
|
||||
strcat(str(tnum++), ': sin(0, 1e-10) == 0'));
|
||||
vrfy(sin(pi/6, 1e-10) == 0.5,
|
||||
strcat(str(tnum++), ': sin(pi/6, 1e-10) == 0.5'));
|
||||
|
||||
/* test versed trigonometric sine */
|
||||
vrfy(versin(0, 1e-10) == 0,
|
||||
strcat(str(tnum++), ': versin(0, 1e-10) == 0'));
|
||||
@@ -8297,7 +8303,7 @@ return test_list();
|
||||
|
||||
|
||||
/*
|
||||
* test 15dd: test the a55 shuffle pseudo-random number generator
|
||||
* test 15dd: test the subtractive 100 shuffle pseudo-random number generator
|
||||
*/
|
||||
print;
|
||||
return test_rand();
|
||||
|
Reference in New Issue
Block a user