ta 0.5.0

Technical analysis library. Implements number of indicators: EMA, SMA, RSI, MACD, Stochastic, etc.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Returns the largest of 3 given numbers.
pub fn max3(a: f64, b: f64, c: f64) -> f64 {
    a.max(b).max(c)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_max3() {
        assert_eq!(max3(3.0, 2.0, 1.0), 3.0);
        assert_eq!(max3(2.0, 3.0, 1.0), 3.0);
        assert_eq!(max3(2.0, 1.0, 3.0), 3.0);
    }
}