Commit Graph

9 Commits

Author SHA1 Message Date
Robert Ramey
a06d9f7a69 added constexpr tests to checked result operations
added tests for check result < and == operations
correct implementation of some checked result types
added constexpr example
2018-12-10 14:12:47 -08:00
Robert Ramey
f46f0ff078
Update README.md 2018-10-17 08:20:37 -07:00
Robert Ramey
4b7df1079d merged in (by hand all but 2 PRs which are still under consideration. 2017-04-08 15:04:56 -07:00
insideoutclub
1d283ac69e Update README.md
Fixed some typos.
2017-03-02 11:27:13 -08:00
Robert Ramey
5f488b2040 update github read to properly display documentation 2015-12-07 23:06:19 -08:00
Robert Ramey
64937c1d64 update link to documentation 2014-04-22 14:59:15 -07:00
Robert Ramey
ea9d15cb1c Update README.md 2013-11-08 08:37:36 -08:00
Robert Ramey
087a913d6c Update README.md
Arithmetic operations in C++ are NOT guarenteed to yield a correct mathematical result. This feature is inherited from the early days of C. The behavior of int, unsigned int and others were designed to map closely to the underlying hardware. Computer hardware implements these types as a fixed number of bits. When the result of arithmetic operations exceeds this number of bits, the result is undefined and usually not what the programmer intended. It is incumbent up the C++ programmer to guarentee that this behavior does not result in incorrect behavior of the program. This library implements special versions of these data types which behave exactly like the original ones EXCEPT that the results of these operations are checked to be sure that an exception will be thrown anytime an attempt is made to store the result of an undefined operation.

Additionally, we define data types safe_signed_range<MIN, MAX> and safe_unsigned_range<MIN, MAX> which will throw an exception if an attempt is made to store a result which is outside the closed range [MIN, MAX]
2013-11-08 08:28:14 -08:00
Robert Ramey
1569b9bd75 Create README.md
Arithmetic operations in C++ are NOT guarenteed to yield a correct mathematical result. This feature is inherited from the early days of C. The behavior of int, unsigned int and others were designed to map closely to the underlying hardware. Computer hardware implements these types as a fixed number of bits. When the result of arithmetic operations exceeds this number of bits, the result is undefined and usually not what the programmer intended. It is incumbent up the C++ programmer to guarentee that this behavior does not result in incorrect behavior of the program. This library implements special versions of these data types which behave exactly like the original ones EXCEPT that the results of these operations are checked to be sure that an exception will be thrown anytime an attempt is made to store the result of an undefined operation.

Additionally, we define data types safe_signed_range<MIN, MAX> and safe_unsigned_range<MIN, MAX> which will throw an exception if an attempt is made to store a result which is outside the closed range [MIN, MAX]
2013-11-08 08:14:45 -08:00