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