abs

Crates.ioabs
lib.rsabs
version0.1.1
sourcesrc
created_at2022-03-24 06:16:03.95017
updated_at2022-03-27 04:02:23.052874
descriptiongeneric absolute value
homepage
repository
max_upload_size
id555617
size1,702
(btwiuse)

documentation

README

Example usage:

#[test]
fn it_works_for_f64_1() {
    assert_ne!(abs(3.1f64, 2.5f64), 0.6f64);
    assert_eq!(abs(3.1f64, 2.5f64), 0.6000000000000001f64);
}

#[test]
fn it_works_for_i32() {
    assert_eq!(abs(42i32, 69i32), 27i32);
}

#[test]
fn it_works_for_u8() {
    assert_eq!(abs(42u8, 69u8), 27u8);
}
Commit count: 0

cargo fmt