Skip to content

A library for Arithmetic Sequences written in Rust.

Notifications You must be signed in to change notification settings

samitixyz/Lukkid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);
    }
}

About

A library for Arithmetic Sequences written in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages