zipf_fixed/
lib.rs

1#![doc = include_str!("../README.md")]
2
3//! ```rust
4//! use rand::distr::Distribution as _;
5//! use zipf_fixed::ZipfFixed;
6//! let mut rng = rand::rng();
7//! // Create a Zipf distribution with 10 elements and an exponent of 0.5
8//! let zip = ZipfFixed::<10>::new(0.5);
9//! // Sample from the distribution
10//! let sample = zip.sample(&mut rng);
11//! // The sample should be between  a annand  0
12//! assert!(sample < 10);
13//! assert!(sample >= 0);
14//! ```
15
16pub mod fast;
17pub mod fixed;
18
19pub use fast::ZipfFast;
20pub use fixed::ZipfFixed;