Skip to content

purpleposeidon/cheque

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Provides a macro allow natural usage of checked math.

Documentation.

let a = 5u8;
let b = 20u8;
let z = 0u8;
 
checked_wrap![a, b, z];
 
assert_eq!(*(a + b), Some(25));
assert_eq!(*(b * b), None);
assert_eq!(*(a - b), None);
assert_eq!(*(b / z), None);
assert_eq!(*(a - 20), None);
assert_eq!(*((a - b) + 1), None);

About

Convenient checked math in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages