Skip to content

Commit 9d2ef95

Browse files
authored
Merge pull request #542 from TheIronBorn/patch-5
fix SIMD integer endian
2 parents c4cbb55 + 9307e42 commit 9d2ef95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/distributions/integer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ macro_rules! simd_impl {
9595
impl Distribution<$ty> for Standard {
9696
#[inline]
9797
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> $ty {
98-
let mut vec = Default::default();
98+
let mut vec: $ty = Default::default();
9999
unsafe {
100100
let ptr = &mut vec;
101101
let b_ptr = &mut *(ptr as *mut $ty as *mut [u8; $bits/8]);
102102
rng.fill_bytes(b_ptr);
103103
}
104-
vec
104+
vec.to_le()
105105
}
106106
}
107107
}

0 commit comments

Comments
 (0)