Changeset 0438091 for src/examples


Ignore:
Timestamp:
Mar 22, 2016, 10:39:34 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

modify stdlib random to not use C library routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/random.c

    r94980502 r0438091  
    77
    88int main() {
    9         randseed( getpid() );                                                           // set random seed
     9        rand48seed( getpid() );                                                         // set random seed
    1010
    1111        // test polymorphic calls to random and stream
    12         char c = random();
     12        char c = rand48();
    1313        sout | c | endl;
    14         int i = random();
     14        int i = rand48();
    1515    sout | i | endl;
    16         unsigned int ui = random();
     16        unsigned int ui = rand48();
    1717    sout | ui | endl;
    18         long int li = random();
     18        long int li = rand48();
    1919    sout | li | endl;
    20         unsigned long int uli = random();
     20        unsigned long int uli = rand48();
    2121    sout | uli | endl;
    22     float f = random();
     22    float f = rand48();
    2323    sout | f | endl;
    24     double d = random();
     24    double d = rand48();
    2525    sout | d | endl;
    26     float _Complex fc = random();
     26    float _Complex fc = rand48();
    2727    sout | fc | endl;
    28     double _Complex dc = random();
     28    double _Complex dc = rand48();
    2929    sout | dc | endl;
    30     long double _Complex ldc = random();
     30    long double _Complex ldc = rand48();
    3131    sout | ldc | endl;
    3232} // main
Note: See TracChangeset for help on using the changeset viewer.