processig 0.0.2

digital signal processing tools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::ops::Sub;
use std::fmt::Debug;

pub fn nearly_equal<'a, T>( aa: &'a T, bb: & 'a T, ee: & 'a T ) -> bool
    where & 'a T: Sub< Output = T > + PartialOrd,
          T: Sub< Output = T > + Clone + PartialOrd + Debug
{
    let dd = if aa < bb {
        bb-aa
    } else {
        aa-bb
    };
    let e1 = ee.clone();
    dd < e1       
}