Commit Graph

343 Commits

Author SHA1 Message Date
Robert Ramey
7fbaff67ba corrected misc documentation errors 2014-08-31 15:37:28 -07:00
Robert Ramey
561efa82a8 latest version - problem with circular reference to limits.hpp 2014-08-31 15:06:36 -07:00
Robert Ramey
d5c921a55b managed to get native.hpp to compile - but still have problems production a safe result 2014-07-11 14:46:31 -07:00
Robert Ramey
e914250ffb replaced list of targets with CMake code which creates a target for each *.cpp file 2014-07-06 14:50:32 -07:00
Robert Ramey
c65302a23d replace list of targets with one target per *.cpp file 2014-07-06 14:43:59 -07:00
Robert Ramey
cf9fefe1d1 Merge branch 'master' into policies
Conflicts:
	CMake/CMakeLists.txt
2014-07-06 14:07:19 -07:00
Robert Ramey
72fa8a1a28 temp commit 2014-07-06 13:34:33 -07:00
Robert Ramey
01a51ffea8 psses test.copp 2014-07-06 11:07:24 -07:00
Robert Ramey
24af3a8a7e compiles test.cpp w/o errors
implements safe_tag to distinguish "safe" types
2014-07-06 09:40:11 -07:00
Robert Ramey
831231d9de intermediate version - first look at policies 2014-07-04 08:49:57 -07:00
Robert Ramey
0e9e73eaf6 fixed up examples 2014-07-01 13:57:02 -07:00
Robert Ramey
557ffc61ad first cut at policies - not there yet 2014-07-01 13:31:25 -07:00
Robert Ramey
1e2016518e fixed up examples 2014-06-15 10:30:11 -07:00
Robert Ramey
64937c1d64 update link to documentation 2014-04-22 14:59:15 -07:00
Robert Ramey
c2c093379d adjustments to make test_conversion pass
All tests pass in Debug and Release!!!
2014-04-20 18:10:15 -07:00
Robert Ramey
2bfc6d4381 fix subtraction
passes all tests
2014-04-20 15:24:08 -07:00
Robert Ramey
742f536338 improve local operations - no tests for these yet 2014-04-16 11:07:30 -07:00
Robert Ramey
a420669fcb test_modulus
improvements to logical/shift operations
2014-04-15 23:01:42 -07:00
Robert Ramey
ee09a4371b test divide passes 2014-04-15 16:25:20 -07:00
Robert Ramey
da574497e5 working
test add
test cast
test compare
test conversion
test subtract
test multiply
2014-04-14 14:41:48 -07:00
Robert Ramey
257f806f0b working:
test_multiply
test_cast
2014-04-13 20:18:27 -07:00
Robert Ramey
cef6bcd465 intermediat changes
almost have safe multiplication working.  Fails 4 test cases.  BUT these cases require more than trivial changes so I'm checking in this intermediate version
2014-04-11 11:27:20 -07:00
Robert Ramey
09d3149412 Got all tests for subtraction to pass. 2014-04-08 08:22:22 -07:00
Robert Ramey
12f5843f90 Fixed problems in testing addition operations
More carefully defined the concepts.  That is the concept of the library is now clear:

Trap at either compile or runtime integer operations which yield a result which differs from the normal arithmetic result.

Pending on this check in:
a) only addition is fixed up so far
b) uses BOOST_TYPEOF... rather than decltype(... - final decision sill pending.
c) comments out some compile time checks which should be re-instated.
d) fixed tests so that they actually work!
2014-04-05 12:22:25 -07:00
Robert Ramey
050f6748b9 minor adjustments in tests from Clang testing 2014-02-11 14:37:31 -08:00
Robert Ramey
52a8c3ddf9 removed .DS_Store files 2014-01-31 16:52:30 -08:00
Robert Ramey
d596cb526c change to README.md file 2013-11-22 16:47:32 -08:00
Robert Ramey
41b6082351 moved png files 2013-11-22 16:41:50 -08:00
Robert Ramey
8b3467cb39 moved png images 2013-11-22 16:38:40 -08:00
Robert Ramey
3c43e56952 added png for navigation 2013-11-22 16:23:31 -08: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
Robert Ramey
b9845327d1 eliminated redundant root directory 2013-11-04 11:44:56 -08:00
Robert Ramey
17f0b1a7b4 Merge pull request #2 from ruslo/same.examples
Fix example3
2013-10-01 09:43:46 -07:00
Robert Ramey
5530fd4e90 Merge pull request #3 from ruslo/compare.errors
Fixed compare errors.
2013-10-01 09:43:18 -07:00
Ruslan Baratov
a07f5be2e7 Fixed compare errors.
When values are equal operators: 'operator<', 'operator>', 'operator>=' and
'operator<=' produce incorrect result. Add test test_compare.cpp.
2013-09-25 22:21:19 +04:00
Ruslan Baratov
9b58f3a267 Print some info about running example 2013-09-25 16:36:18 +04:00
Ruslan Baratov
1694d9482e Fix example3
Examples 2 and 3 is the same.
Change example 3 to show incorrect int to char conversion.
2013-09-25 16:15:15 +04:00
Robert Ramey
f3126f0b40 added tutorials 2012-12-04 22:33:56 -08:00
Robert Ramey
1ea4756a1f corrected directory name 2012-12-04 13:34:52 -08:00
Robert Ramey
5b528d424a updateed docments 2012-12-04 12:30:39 -08:00
Robert Ramey
69c3e12e16 initial commit to Git for GitHub 2012-07-13 09:11:40 -08:00