October 2019
Intermediate to advanced
444 pages
10h 37m
English
Let's use Rust's unit tests as a playground for some data type experiments:
#[cfg(test)]mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); }}
#[test] fn basic_math_stuff() { assert_eq!(2 + 2, 4); assert_eq!(3.14 + 22.86, 26_f32); assert_eq!(2_i32.pow(2), 4); assert_eq!(4_f32.sqrt(), 2_f32); let a: u64 = 32; ...Read now
Unlock full access