abs 0.1.1

generic absolute value
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 1.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 997.19 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • btwiuse

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