saturating 0.1.0

Provides Saturating<T>, an intentionally-saturating arithmetic wrapper.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 8.07 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.7 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • breezewish/saturating-rs
    4 1 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • breezewish

saturating-rs

Build Status

Saturating<T> is an intentionally-saturating arithmetic wrapper, similar to std::num::Wrapping.

Examples

use saturating::Saturating;

let foo = Saturating(253u8);
let bar = Saturating(100u8);

assert_eq!(std::u8::MAX, (foo + bar).0);