Added unsigned type arithmetic and type conversion overflow detection. #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello @JohnCGriffin
I saw this library recently and thought it was very well written. But as you said there is lack of arithmetic support on unsigned types and type conversion overflow detection like integer type safety libraries in other languages. Although it has been many years, I think it makes sense to perfect it.
I submitted couple commits to this project, which are used to add arithmetic overflow detection for unsigned types, integer type conversion detection with different signs and sizes, add safe absolute value operation and to improve the README and some comments, also merged a PR from @fesiqueira which add a explicit license file.
The newly added code has been tested and benchmarked as the README says, although the benchmark function is not retained in the test file. I still use your username as the download way for this PR, but for the convenience of others before being merged, my fork repo readme is using my username as the download way.