Go to file
Robert Ramey 8ff0f8538c Permit compilation with -fno-exceptions.
If one invokes throw_exception by accident, should fail to link.
2019-10-25 11:36:59 -07:00
doc fix links to *.hpp files in documentation 2019-05-10 04:31:00 -07:00
example Fix ends of lines, remove executable permission (#72) 2019-06-23 12:12:57 -07:00
include/boost/safe_numerics Permit compilation with -fno-exceptions. 2019-10-25 11:36:59 -07:00
meta Use the category keywords in metadata 2018-10-30 09:11:25 +00:00
test Fix ends of lines, remove executable permission (#72) 2019-06-23 12:12:57 -07:00
.travis.yml Updated for b2 cmake support. 2018-12-20 10:13:38 -05:00
appveyor.yml Updated for b2 cmake support. 2018-12-20 10:13:38 -05:00
CMakeLists.txt Permit compilation with -fno-exceptions. 2019-10-25 11:36:59 -07:00
index.html merged in (by hand all but 2 PRs which are still under consideration. 2017-04-08 15:04:56 -07:00
Jamfile.v2 added example based on rational.hpp 2017-06-27 22:56:11 -07:00
LICENSE_1_0.txt merged in (by hand all but 2 PRs which are still under consideration. 2017-04-08 15:04:56 -07:00
README.md added constexpr tests to checked result operations 2018-12-10 14:12:47 -08:00

safe_numerics

Arithmetic operations in C++ are NOT guaranteed 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 upon the C++ programmer to guarantee 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.

Note: This is the subject of a various presentations at CPPCon.

The first one is a short version which gives the main motivation for the library with a rowsing sales pitch. Fun and suitable for upper management. https://www.youtube.com/watch?v=cw_8QkFXZjI&t=1s

The second is more extensive in that it addresses a real world case study which touches on most of the important aspects of the libary. https://www.youtube.com/watch?v=93Cjg42bGEw .

Finally, for those who still enjoy the written word there is the documentation in which significant effort has been invested. http://htmlpreview.github.io/?https://github.com/robertramey/safe_numerics/master/doc/html/index.html