32 #ifndef _random123_ufixed01_dot_h_
33 #define _random123_ufixed01_dot_h_
117 #define R123_0x1p_31f (1.f/(1024.f*1024.f*1024.f*2.f))
118 #define R123_0x1p_24f (128.f*R123_0x1p_31f)
119 #define R123_0x1p_23f (256.f*R123_0x1p_31f)
120 #define R123_0x1p_32 (1./(1024.*1024.*1024.*4.))
121 #define R123_0x1p_63 (2.*R123_0x1p_32*R123_0x1p_32)
122 #define R123_0x1p_53 (1024.*R123_0x1p_63)
123 #define R123_0x1p_52 (2048.*R123_0x1p_63)
127 #ifndef R123_USE_U01_DOUBLE
128 #define R123_USE_U01_DOUBLE
138 return ((i&0x7fffffc0) + (i&0x40))*R123_0x1p_31f;
142 return (i>>8)*R123_0x1p_24f;
146 return (1+(i>>8))*R123_0x1p_24f;
150 return (0.5f+(i>>9))*R123_0x1p_23f;
153 #if R123_USE_U01_DOUBLE
157 return ((i&R123_64BIT(0x7ffffffffffffe00)) + (i&0x200))*R123_0x1p_63;
161 return (i>>11)*R123_0x1p_53;
165 return (1+(i>>11))*R123_0x1p_53;
169 return (0.5+(i>>12))*R123_0x1p_52;
179 return (((
double)(i&1)) + i)*R123_0x1p_32;
183 return i*R123_0x1p_32;
187 return (1.+i)*R123_0x1p_32;
191 return (0.5+i)*R123_0x1p_32;
static float u01fixedpt_closed_open_32_float(uint32_t i)
Definition: u01fixedpt.h:141
static double u01fixedpt_open_closed_32_double(uint32_t i)
Definition: u01fixedpt.h:186
static double u01fixedpt_closed_closed_64_double(uint64_t i)
Definition: u01fixedpt.h:155
static double u01fixedpt_open_open_32_double(uint32_t i)
Definition: u01fixedpt.h:190
static float u01fixedpt_open_open_32_float(uint32_t i)
Definition: u01fixedpt.h:149
static double u01fixedpt_closed_closed_32_double(uint32_t i)
Definition: u01fixedpt.h:173
static double u01fixedpt_closed_open_32_double(uint32_t i)
Definition: u01fixedpt.h:182
static double u01fixedpt_open_open_64_double(uint64_t i)
Definition: u01fixedpt.h:168
static double u01fixedpt_open_closed_64_double(uint64_t i)
Definition: u01fixedpt.h:164
static float u01fixedpt_closed_closed_32_float(uint32_t i)
Definition: u01fixedpt.h:136
static double u01fixedpt_closed_open_64_double(uint64_t i)
Definition: u01fixedpt.h:160
static float u01fixedpt_open_closed_32_float(uint32_t i)
Definition: u01fixedpt.h:145