Changeset 0438091 for src/examples
- Timestamp:
- Mar 22, 2016, 10:39:34 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 6a57da5
- Parents:
- 94980502
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/random.c
r94980502 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.