Crate wrapnum

Crate wrapnum 

Source
Expand description

Ever wanted to just make a number and have it automatically wrap around an arbitrary minimum/maximum without ever thinking about it after creating the number? Here you go.

The goal of this is to act as much like any other integer type available, so that you can just think of this as a number and leave all the wrapping to us!

§Notes

This library uses logic that does not change between debug and release modes, unlike some methods like std::intrinsics::wrapping_add(). As such, this library is not meant to be performance critical; it is simply meant to be a “one-and-done forget about it” variable.

Macros§

wrap
Create WrapNum with value, minimum and maximum.

Structs§

WrapNum
Number with arbitrary wrapping.