Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mruby_mbed_web mirb_mbed
mt19937ar.h
00001 /* 00002 ** mt19937ar.h - MT Random functions 00003 ** 00004 ** See Copyright Notice in mruby.h 00005 */ 00006 00007 #define N 624 00008 00009 typedef struct { 00010 unsigned long mt[N]; 00011 int mti; 00012 union { 00013 unsigned long int_; 00014 double double_; 00015 } gen; 00016 00017 mrb_int seed; 00018 mrb_bool has_seed : 1; 00019 } mt_state; 00020 00021 void mrb_random_init_genrand(mt_state *, unsigned long); 00022 unsigned long mrb_random_genrand_int32(mt_state *); 00023 double mrb_random_genrand_real1(mt_state *t); 00024 00025 /* initializes mt[N] with a seed */ 00026 void init_genrand(unsigned long s); 00027 00028 /* initialize by an array with array-length */ 00029 /* init_key is the array for initializing keys */ 00030 /* key_length is its length */ 00031 /* slight change for C++, 2004/2/26 */ 00032 void init_by_array(unsigned long init_key[], int key_length); 00033 00034 /* generates a random number on [0,0xffffffff]-interval */ 00035 unsigned long genrand_int32(void); 00036 00037 /* generates a random number on [0,0x7fffffff]-interval */ 00038 long genrand_int31(void); 00039 00040 /* These real versions are due to Isaku Wada, 2002/01/09 added */ 00041 /* generates a random number on [0,1]-real-interval */ 00042 double genrand_real1(void); 00043 00044 /* generates a random number on [0,1)-real-interval */ 00045 double genrand_real2(void); 00046 00047 /* generates a random number on (0,1)-real-interval */ 00048 double genrand_real3(void); 00049 00050 /* generates a random number on [0,1) with 53-bit resolution*/ 00051 double genrand_res53(void); 00052
Generated on Tue Jul 12 2022 18:00:34 by
1.7.2