bcd 0.1.0

Binary coded decimal library
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub struct BinaryFibIter(usize, usize);

impl BinaryFibIter {
    pub fn new() -> BinaryFibIter {
        BinaryFibIter(0, 1)
    }
}

impl Iterator for BinaryFibIter {
    type Item = usize;
    fn next(&mut self) -> Option<usize> {
        *self = BinaryFibIter(self.1, self.0 + self.1);
        Some(self.1)
    }
}