Crates.io | lukkid |
lib.rs | lukkid |
version | 0.1.0 |
source | src |
created_at | 2020-09-21 08:52:32.875874 |
updated_at | 2020-09-21 08:52:32.875874 |
description | lukkid is a library for Arithmetic Sequences. |
homepage | |
repository | https://github.com/samiti3d/Lukkid/ |
max_upload_size | |
id | 291050 |
size | 4,881 |
#[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);
}
}