1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Functions related to the Fibonacci sequence.
use crate;
/// Creates an iterator over all Fibonacci numbers that are representable by the generic type.
///
/// # Examples
///
/// ```
/// use polymatheia::fibonacci;
///
/// let mut fib = fibonacci::sequence::<u8>();
///
/// assert_eq!(fib.next(), Some(0));
/// assert_eq!(fib.next(), Some(1));
/// assert_eq!(fib.next(), Some(1));
/// assert_eq!(fib.last(), Some(233));
/// ```
/// An iterator over all Fibonacci numbers that are representable by the generic type.
///
/// This `struct` is created by the [`sequence()`] function. See its documentation for more.