migrate PCG
diff --git a/rand_pcg/src/pcg128.rs b/rand_pcg/src/pcg128.rs
index 58a8e36..e4e455b 100644
--- a/rand_pcg/src/pcg128.rs
+++ b/rand_pcg/src/pcg128.rs
@@ -96,6 +96,11 @@
impl RngCore for Lcg128Xsl64 {
#[inline]
+ fn next_bool(&mut self) -> bool {
+ (self.next_u64() & 1) == 1
+ }
+
+ #[inline]
fn next_u32(&mut self) -> u32 {
self.next_u64() as u32
}
@@ -175,6 +180,11 @@
impl RngCore for Mcg128Xsl64 {
#[inline]
+ fn next_bool(&mut self) -> bool {
+ (self.next_u64() & 1) == 1
+ }
+
+ #[inline]
fn next_u32(&mut self) -> u32 {
self.next_u64() as u32
}
diff --git a/rand_pcg/src/pcg64.rs b/rand_pcg/src/pcg64.rs
index ed7442f..729b383 100644
--- a/rand_pcg/src/pcg64.rs
+++ b/rand_pcg/src/pcg64.rs
@@ -95,6 +95,11 @@
impl RngCore for Lcg64Xsh32 {
#[inline]
+ fn next_bool(&mut self) -> bool {
+ (self.next_u32() & 1) == 1
+ }
+
+ #[inline]
fn next_u32(&mut self) -> u32 {
let state = self.state;
self.step();