@@ -15,7 +15,7 @@ use Rng;
1515use  distributions:: { Distribution ,  Standard } ; 
1616use  distributions:: utils:: FloatSIMDUtils ; 
1717#[ cfg( feature="simd_support" ) ]  
18- use  core :: simd :: * ; 
18+ use  packed_simd :: * ; 
1919
2020/// A distribution to sample floating point numbers uniformly in the half-open 
2121/// interval `(0, 1]`, i.e. including 1 but not 0. 
@@ -106,7 +106,7 @@ macro_rules! float_impls {
106106                // Multiply-based method; 24/53 random bits; [0, 1) interval. 
107107                // We use the most significant bits because for simple RNGs 
108108                // those are usually more random. 
109-                 let  float_size = mem:: size_of:: <$f_scalar>( )  *  8 ; 
109+                 let  float_size = mem:: size_of:: <$f_scalar>( )  as   u32   *  8 ; 
110110                let  precision = $fraction_bits + 1 ; 
111111                let  scale = 1.0  / ( ( 1  as  $u_scalar << precision)  as  $f_scalar) ; 
112112
@@ -121,7 +121,7 @@ macro_rules! float_impls {
121121                // Multiply-based method; 24/53 random bits; (0, 1] interval. 
122122                // We use the most significant bits because for simple RNGs 
123123                // those are usually more random. 
124-                 let  float_size = mem:: size_of:: <$f_scalar>( )  *  8 ; 
124+                 let  float_size = mem:: size_of:: <$f_scalar>( )  as   u32   *  8 ; 
125125                let  precision = $fraction_bits + 1 ; 
126126                let  scale = 1.0  / ( ( 1  as  $u_scalar << precision)  as  $f_scalar) ; 
127127
@@ -138,7 +138,7 @@ macro_rules! float_impls {
138138                // We use the most significant bits because for simple RNGs 
139139                // those are usually more random. 
140140                use  core:: $f_scalar:: EPSILON ; 
141-                 let  float_size = mem:: size_of:: <$f_scalar>( )  *  8 ; 
141+                 let  float_size = mem:: size_of:: <$f_scalar>( )  as   u32   *  8 ; 
142142
143143                let  value:  $uty = rng. gen ( ) ; 
144144                let  fraction = value >> ( float_size - $fraction_bits) ; 
@@ -174,7 +174,7 @@ mod tests {
174174    use  distributions:: { Open01 ,  OpenClosed01 } ; 
175175    use  rngs:: mock:: StepRng ; 
176176    #[ cfg( feature="simd_support" ) ]  
177-     use  core :: simd :: * ; 
177+     use  packed_simd :: * ; 
178178
179179    const  EPSILON32 :  f32  = :: core:: f32:: EPSILON ; 
180180    const  EPSILON64 :  f64  = :: core:: f64:: EPSILON ; 
0 commit comments