SCalc

A type that ensures calculation safety and prevents itself from overflow

Get started

``` use scalc::SCell;

fn main() { let a = SCell::::new(12) * SCell::::new(3); asserteq!(*a.getdata(), 36);

// error_tag will be true in the presence of overflow behavior(s) let a = SCell::::new(std::i32::MAX) + SCell::::new(1); asserteq!(a.isoverflowed(), true); asserteq!(*a.getdata(), 1); } `` You can also use [*New Type Idiom*](https://doc.rust-lang.org/stable/rust-by-example/generics/new_types.html) in combination of [derivemore`](https://github.com/JelteF/derivemore) to have better experience.