mmc_rand_drand48.h
Go to the documentation of this file.
1 /***************************************************************************/
32 /***************************************************************************/
38 #ifndef _MMC_POSIX_RAND_LIBGW32C_H
39 #define _MMC_POSIX_RAND_LIBGW32C_H
40 
41 #include <stdlib.h>
42 #include <stdio.h>
43 #include <math.h>
44 #include <float.h>
45 #include <ieee754.h>
46 #include <string.h>
47 
48 //typedef unsigned long long uint64_t
49 
50 typedef signed __int8 sint8;
51 typedef unsigned __int8 uint8;
52 typedef signed __int16 sint16;
53 typedef unsigned __int16 uint16;
54 typedef signed __int32 sint32;
55 typedef unsigned __int32 uint32;
56 typedef signed __int64 sint64;
57 typedef unsigned __int64 uint64;
58 
59 
67 struct drand48_data {
68  unsigned short int __x[3]; /* Current state. */
69  unsigned short int __old_x[3]; /* Old state. */
70  unsigned short int __c; /* Additive const. in congruential formula. */
71  unsigned short int __init; /* Flag for initializing. */
72  uint64 __a; /* Factor in congruential formula. */
73 };
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
79 
80 /* Global state for non-reentrant functions. */
81 int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data* buffer );
82 int __erand48_r (unsigned short int xsubi[3], struct drand48_data* buffer, double* result);
83 int drand48_r (struct drand48_data* buffer, double* result);
84 int seed48_r (unsigned short int seed16v[3], struct drand48_data* buffer);
85 double erand48 ( unsigned short int xsubi[3]);
86 
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif
Data structure for communication with thread safe versions.
Definition: mmc_rand_drand48.h:67