Changes in src/examples/random.c [6ba0659:0438091]
- File:
-
- 1 edited
-
src/examples/random.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/examples/random.c
r6ba0659 r0438091 7 7 8 8 int main() { 9 rand seed( getpid() ); // set random seed9 rand48seed( getpid() ); // set random seed 10 10 11 11 // test polymorphic calls to random and stream 12 char c = rand om();12 char c = rand48(); 13 13 sout | c | endl; 14 int i = rand om();14 int i = rand48(); 15 15 sout | i | endl; 16 unsigned int ui = rand om();16 unsigned int ui = rand48(); 17 17 sout | ui | endl; 18 long int li = rand om();18 long int li = rand48(); 19 19 sout | li | endl; 20 unsigned long int uli = rand om();20 unsigned long int uli = rand48(); 21 21 sout | uli | endl; 22 float f = rand om();22 float f = rand48(); 23 23 sout | f | endl; 24 double d = rand om();24 double d = rand48(); 25 25 sout | d | endl; 26 float _Complex fc = rand om();26 float _Complex fc = rand48(); 27 27 sout | fc | endl; 28 double _Complex dc = rand om();28 double _Complex dc = rand48(); 29 29 sout | dc | endl; 30 long double _Complex ldc = rand om();30 long double _Complex ldc = rand48(); 31 31 sout | ldc | endl; 32 32 } // main
Note:
See TracChangeset
for help on using the changeset viewer.