We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 987a975 commit 3dc934dCopy full SHA for 3dc934d
src/binomial.rs
@@ -43,6 +43,12 @@ use rand::Rng;
43
/// let v = bin.sample(&mut rand::rng());
44
/// println!("{} is from a binomial distribution", v);
45
/// ```
46
+///
47
+/// # Numerics
48
+/// The implementation uses `f64` internally, which leads to rounding errors for big numbers.
49
+/// For very large samples (`> 2^53`) the least significant bits of the output will not be random.
50
+/// This means that something like `bin.sample(&mut rand::rng()) % 4` will not follow the correct distribution.
51
+/// The more significant bits should be correctly distributed.
52
#[derive(Clone, Copy, Debug, PartialEq)]
53
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
54
pub struct Binomial {
0 commit comments