Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

mauricelam/rust-arithmetic-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Macros for changing arithmetic modes (wrapping / saturating / checked etc)

Provides checked!, panicking!, wrapping! and saturating! macros to change how arithmetic overflows are handled.

This crate currently not published on crates.io

Example

use arithmetic_mode::wrapping;

wrapping! { 1_i32 + 2_i32 - 3_i32 };

Supported operations:

Known issues

  • For most operations, constraining the numeric literals are required (e.g. 2_i32 instead of 2), due to rust-lang/rust#24124.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages