Skip to content

A small library providing wrappers for numeric types that constrain their value within specified bounds.

License

Notifications You must be signed in to change notification settings

dhildebr/clamped-numbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Clamped Numbers

The C++ Clamped Numbers API provides wrappers for numeric types like int and double which constrain their values to within specified bounds. Custom numeric types (such as one representing roman numeral values) can also be used with these wrappers provided they implement the necessary operators.

There are three class templates for wrapping different types of numbers. ClampedNaturalNumber is designed to wrap unsigned integral types like size_t and corresponds with the set of natural numbers (including zero), ℕ. ClampedInteger is designed to wrap signed integral types like int amd corresponds with the set of integers, ℤ. Lastly, ClampedDecimal is designed to wrap floating-point types like double and corresponds with the set of all real numbers, ℝ.

About

A small library providing wrappers for numeric types that constrain their value within specified bounds.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published