Ignore:
Timestamp:
Oct 31, 2017, 1:21:02 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c59bde6
Parents:
fa477f7
Message:

rename rand48 to random, rand48seed to random_seed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib.c

    rfa477f7 r70e4895  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Oct 30 17:53:04 2017
    13 // Update Count     : 295
     12// Last Modified On : Mon Oct 30 22:43:02 2017
     13// Update Count     : 297
    1414//
    1515
     
    275275//---------------------------------------
    276276
    277 void rand48seed( long int s ) { srand48( s ); }
    278 char rand48( void ) { return mrand48(); }
    279 char rand48( char l, char u ) { return lrand48() % (u - l) + l; }
    280 int rand48( void ) { return mrand48(); }
    281 unsigned int rand48( void ) { return lrand48(); }
    282 unsigned int rand48( unsigned int u ) { return lrand48() % u; }
    283 unsigned int rand48( unsigned int l, unsigned int u ) { return lrand48() % (u - l) + l; }
    284 long int rand48( void ) { return mrand48(); }
    285 unsigned long int rand48( void ) { return lrand48(); }
    286 unsigned long int rand48( unsigned long int u ) { return lrand48() % u; }
    287 unsigned long int rand48( unsigned long int l, unsigned long int u ) { return lrand48() % (u - l) + l; }
    288 float rand48( void ) { return (float)drand48(); }               // otherwise float uses lrand48
    289 double rand48( void ) { return drand48(); }
    290 float _Complex rand48( void ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); }
    291 double _Complex rand48( void ) { return drand48() + (double _Complex)(drand48() * _Complex_I); }
    292 long double _Complex rand48( void) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); }
     277void random_seed( long int s ) { srand48( s ); }
     278char random( void ) { return mrand48(); }
     279char random( char l, char u ) { return lrand48() % (u - l) + l; }
     280int random( void ) { return mrand48(); }
     281unsigned int random( void ) { return lrand48(); }
     282unsigned int random( unsigned int u ) { return lrand48() % u; }
     283unsigned int random( unsigned int l, unsigned int u ) { return lrand48() % (u - l) + l; }
     284//long int random( void ) { return mrand48(); }
     285unsigned long int random( void ) { return lrand48(); }
     286unsigned long int random( unsigned long int u ) { return lrand48() % u; }
     287unsigned long int random( unsigned long int l, unsigned long int u ) { return lrand48() % (u - l) + l; }
     288float random( void ) { return (float)drand48(); }               // otherwise float uses lrand48
     289double random( void ) { return drand48(); }
     290float _Complex random( void ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); }
     291double _Complex random( void ) { return drand48() + (double _Complex)(drand48() * _Complex_I); }
     292long double _Complex random( void) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); }
    293293
    294294//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.