Changes in src/tests/random.c [54aba8d:6c7b1e7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/random.c
r54aba8d r6c7b1e7 10 10 // Created On : Tue Jul 5 21:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 2 12:19:34 201813 // Update Count : 1912 // Last Modified On : Mon Oct 30 23:06:49 2017 13 // Update Count : 6 14 14 // 15 15 … … 19 19 20 20 int main() { 21 // 22 srandom( 1003 );// fixed seed for repeatable tests21 //srandom( getpid() ); // set random seed 22 random_seed( 1003 ); // fixed seed for repeatable tests 23 23 24 24 // test polymorphic calls to random and stream 25 25 char c = random(); 26 26 sout | c | endl; 27 c = random( 'A' );28 sout | c | endl;29 c = random( 'A', 'Z' );30 sout | c | endl;31 32 27 int i = random(); 33 28 sout | i | endl; 34 i = random( 10 );35 sout | i | endl;36 i = random( -10, 20 );37 sout | i | endl;38 39 29 unsigned int ui = random(); 40 30 sout | ui | endl; 41 ui = random( 10u );42 sout | ui | endl;43 ui = random( 10u, 20u );44 sout | ui | endl;45 46 31 long int li = random(); 47 32 sout | li | endl; 48 li = random( 10l );49 sout | li | endl;50 li = random( -10l, 20l );51 sout | li | endl;52 53 33 unsigned long int uli = random(); 54 34 sout | uli | endl; 55 uli = random( 10ul );56 sout | uli | endl;57 uli = random( 10ul, 20ul );58 sout | uli | endl;59 60 35 float f = random(); 61 36 sout | f | endl; 62 63 37 double d = random(); 64 38 sout | d | endl; 65 66 39 float _Complex fc = random(); 67 40 sout | fc | endl; 68 69 41 double _Complex dc = random(); 70 42 sout | dc | endl; 71 72 43 long double _Complex ldc = random(); 73 44 sout | ldc | endl;
Note:
See TracChangeset
for help on using the changeset viewer.