lukkid

Crates.iolukkid
lib.rslukkid
version0.1.0
sourcesrc
created_at2020-09-21 08:52:32.875874
updated_at2020-09-21 08:52:32.875874
descriptionlukkid is a library for Arithmetic Sequences.
homepage
repositoryhttps://github.com/samiti3d/Lukkid/
max_upload_size
id291050
size4,881
smifarmerix (samiti3d)

documentation

README

A library for Arithmetic Sequences.

Example

  • creating your sequence using Sequence()::new(?,?,?);
  • sum all of list using zigma(<<put Sequence() Object here>> );
#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn it_works() {
        let mut c = 0;
        for n in Sequence::new(2,10,2){
            println!("It is: {}", n);
            c += n;
        }
        assert_eq!(c, 20);
        let sl = zigma(Sequence::new(2,10,2), 0);
        assert_eq!(sl, 20);

        let fl = Sequence::new(2, 10, 2).fold(0,|acc,x|acc+x);
        assert_eq!(fl, 20);
    }
}
Commit count: 3

cargo fmt