1 unstable release
0.1.0 | Jul 18, 2019 |
---|
#248 in No standard library
142,170 downloads per month
Used in 131 crates
(2 directly)
8KB
140 lines
saturating-rs
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);
lib.rs
:
Provides Saturating<T>
, 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);