This crate provides a way to test of some given set of numbers conforms to Benford's law
Currently, only the first digit is being used. You can use your own method
of mapping a number to a digit, by implementing [BenfordClass
]
```rust use benford::{BenfordTester, FirstDigitBase10}; use num::CheckedAdd;
struct Fibonacci
impl
fn next(&mut self) -> Option<Self::Item> {
let res = self.0;
self.0 = self.1;
self.1 = match self.1.checked_add(&res) {
Some(sum) => sum,
None => return None,
};
Some(res)
}
}
impl
let mut tester = BenfordTester::default();
let mut fibonacci = Fibonacci::
```rust use benford::{BenfordTester, FirstDigitBase10};
let mut tester = BenfordTester::default();
for val in 1..u16::MAX {
tester.addsample::
License: GPL-3.0