Skip to content

Commit fe5a6e1

Browse files
committed
Zeta: Document cases where infinity is returned
1 parent cf4b7e4 commit fe5a6e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rand_distr/src/zipf.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ use core::fmt;
3131
/// println!("{}", val);
3232
/// ```
3333
///
34+
/// # Remarks
35+
///
36+
/// The zeta distribution has no upper limit. Sampled values may be infinite.
37+
/// In particular, a value of infinity might be returned for the following
38+
/// reasons:
39+
/// 1. it is the best representation in the type `F` of the actual sample.
40+
/// 2. to prevent infinite loops for very small `a`.
41+
///
3442
/// # Implementation details
3543
///
3644
/// We are using the algorithm from [Non-Uniform Random Variate Generation],

0 commit comments

Comments
 (0)