@@ -15,7 +15,7 @@ use Rng;
15
15
use distributions:: { Distribution , Standard } ;
16
16
use distributions:: utils:: FloatSIMDUtils ;
17
17
#[ cfg( feature="simd_support" ) ]
18
- use core :: simd :: * ;
18
+ use packed_simd :: * ;
19
19
20
20
/// A distribution to sample floating point numbers uniformly in the half-open
21
21
/// interval `(0, 1]`, i.e. including 1 but not 0.
@@ -106,7 +106,7 @@ macro_rules! float_impls {
106
106
// Multiply-based method; 24/53 random bits; [0, 1) interval.
107
107
// We use the most significant bits because for simple RNGs
108
108
// 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 ;
110
110
let precision = $fraction_bits + 1 ;
111
111
let scale = 1.0 / ( ( 1 as $u_scalar << precision) as $f_scalar) ;
112
112
@@ -121,7 +121,7 @@ macro_rules! float_impls {
121
121
// Multiply-based method; 24/53 random bits; (0, 1] interval.
122
122
// We use the most significant bits because for simple RNGs
123
123
// 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 ;
125
125
let precision = $fraction_bits + 1 ;
126
126
let scale = 1.0 / ( ( 1 as $u_scalar << precision) as $f_scalar) ;
127
127
@@ -138,7 +138,7 @@ macro_rules! float_impls {
138
138
// We use the most significant bits because for simple RNGs
139
139
// those are usually more random.
140
140
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 ;
142
142
143
143
let value: $uty = rng. gen ( ) ;
144
144
let fraction = value >> ( float_size - $fraction_bits) ;
@@ -174,7 +174,7 @@ mod tests {
174
174
use distributions:: { Open01 , OpenClosed01 } ;
175
175
use rngs:: mock:: StepRng ;
176
176
#[ cfg( feature="simd_support" ) ]
177
- use core :: simd :: * ;
177
+ use packed_simd :: * ;
178
178
179
179
const EPSILON32 : f32 = :: core:: f32:: EPSILON ;
180
180
const EPSILON64 : f64 = :: core:: f64:: EPSILON ;
0 commit comments