Commit Graph

44 Commits

Author SHA1 Message Date
John Maddock
27147f3cb9 Fix clang-9 in C++11/03 mode. 2019-10-24 12:24:52 +01:00
pabristow
86a7142d96 Edits to satisfy the picky inspect.exe program, now passing local tests using MSVC 14.2, except for six cpp_int*serial*.txt testdata files missing licence. 2019-08-14 18:02:10 +01:00
jzmaddock
877753246f clang-format: apply new format to (almost) everything. 2019-07-15 18:25:17 +01:00
jzmaddock
e54fbeec71
Merge pull request #124 from boostorg/Ethereum_tests
Add tests from Ethereum project referenced here: https://github.com/b
2019-06-29 10:32:50 +01:00
jzmaddock
a137f09b3e Fix up use of > to be C++03 compatible. 2019-04-28 19:29:44 +01:00
Tinko Bartels
8740e3863b Replace broken links. 2019-04-23 08:51:47 +02:00
jzmaddock
154e623229 Add tests from Ethereum project referenced here: https://github.com/boostorg/multiprecision/issues/123 2019-03-09 09:50:23 +00:00
jzmaddock
0708fb99d3 cpp_int: incrementing to zero doesn't set the sign correctly.
Fix sign and add tests.
See https://github.com/boostorg/multiprecision/issues/43
2018-02-08 08:45:54 +00:00
jzmaddock
8d04a03850 Multiprecision: Fix msvc-14.1 C++17 warnings. 2017-12-26 19:22:21 +00:00
jzmaddock
841e1d71bb travis: move some test targets around trying to balance the load better.
Define CI_SUPPRESS_KNOWN_ISSUES when building and reduce the testing load when it's set.
2017-05-25 13:33:58 +01:00
jzmaddock
7a2df8ff0a Fix error handing in checked cpp_int multiply.
See https://github.com/boostorg/multiprecision/issues/16
2017-03-05 13:10:13 +00:00
jzmaddock
cd2bbcba5b Fix bounded variable precision cpp_int's.
1) Removed some constexpr optimizations which were causing the code to fail to spot that truncation/overflow had occurred.
2) Change min/max code for numeric_limits to work for bounded variable precision types (this needs more work as the current code relies on being able to create a fixed-precision allocator-free type of equivalent width.
3) Add tests for bounded variable precision integers.
See: https://svn.boost.org/trac/boost/ticket/12798
2017-02-03 19:39:28 +00:00
jzmaddock
4538e88a91 Fix integer sqrt for very small integers.
See https://svn.boost.org/trac/boost/ticket/12559.
2016-11-06 11:58:54 +00:00
jzmaddock
cb1a41835f Use memmove for bitshifts when machine is little endian.
See https://svn.boost.org/trac/boost/ticket/9233.
2016-02-24 12:06:05 +00:00
jzmaddock
59395e2754 Fix integer stream input so it doesn't skip characters.
See https://svn.boost.org/trac/boost/ticket/11857
Update tests to match.
2015-12-22 18:28:23 +00:00
jzmaddock
a1eafc4228 Fix division bug discovered by https://svn.boost.org/trac/boost/ticket/11648 2015-09-22 13:39:26 +01:00
jzmaddock
ea8586a9cf Fix signed exclusive-bitwise-or to handle carry correctly.
See https://svn.boost.org/trac/boost/ticket/11364.
2015-06-02 09:14:16 +01:00
jzmaddock
b7e1992b26 Fix right shifting of negative values in cpp_int.
To give the same values as 2's complement representations,
though not the same bit-pattern.
Updated tests.
Fixed assignment from float to not rely on shifting negative values.
2015-05-30 11:39:39 +01:00
John Maddock
0a3a504f92 Merge multiprecision changes from Trunk.
[SVN r85681]
2013-09-15 18:04:02 +00:00
John Maddock
5245fd31e2 Fix bug in division of zero.
Document and add tests.
Fixes #8160.

[SVN r83128]
2013-02-24 13:20:46 +00:00
John Maddock
1ef61ef160 Fix bug in subtraction routine that leads to -0 rather than 0.
Add test cases.
Fixes #8145.

[SVN r83103]
2013-02-23 17:22:18 +00:00
John Maddock
4a43b9ef8e Fix bug in subtraction of a limb_type.
Fix bug in division/modulus algorithms that results in incorrect sign when source and destination overlap.
Tweak performance of GCD algorithms.
Add test cases for bug reports.
Fixes #8133.
Fixes #8126.

[SVN r83080]
2013-02-22 10:37:36 +00:00
John Maddock
3111e69084 Fix sign of division in cpp_int when the values are small enough to fit in a double_limb_type.
Add test cases for above.
Fixes #8126.

[SVN r83060]
2013-02-21 13:05:41 +00:00
John Maddock
97ba7d573f Fix bug that causes division by single limb to fail when the remainder is zero and the least significant limb of the quotient is 1.
Fixes #7878.

[SVN r82460]
2013-01-12 10:51:46 +00:00
John Maddock
27599ca09e Apply patch for typos.
Regenerate docs.
Fixes #7806.

[SVN r82073]
2012-12-18 11:28:04 +00:00
John Maddock
08fdb31fa2 Add some optimisation to gcd/lcm/lsb and cpp_int:
Use compiler intrinsics where possible for lsb.
Switch to using native integers when the values get small enough for gcd.
Re-run the performance tests and regenerate the docs.

Also change the series evaluation limits to make them depend on the precision in pow.hpp and trig.hpp.

[SVN r81946]
2012-12-14 18:37:27 +00:00
John Maddock
bfd897f5d8 Fix some more GCC warnings and make compiles faster for slow compilers (Intel)
[SVN r81710]
2012-12-04 19:28:46 +00:00
John Maddock
c77b46b4da Add missing -= operator to tests.
[SVN r81622]
2012-11-29 11:04:22 +00:00
John Maddock
114aeb386b Simply enable_if usage in cpp_int_backend: try to fix Intel-11 failures.
Improve test_cpp_int.cpp.
Improve config tests.

[SVN r81487]
2012-11-22 17:21:01 +00:00
John Maddock
09f3928f5a Fix clang failures
[SVN r81464]
2012-11-21 17:54:50 +00:00
John Maddock
645fe8865c Add tests for checked ints and fix failures.
Make negating an unsigned int an error, and fix resulting test failures.
Change allocator defaults to be void when the allocator is not actually required.

[SVN r81070]
2012-10-27 17:48:33 +00:00
John Maddock
a857186cb4 Big "blow it away and start again" refactoring of cpp_int.
Adds support for runtime checking, enumerated template params, fixed precision with allocator, and no "hidden" template parameters.

[SVN r81054]
2012-10-24 16:00:05 +00:00
John Maddock
af9e0c2fe7 Add more explicit constructors and tests for them.
Centralise digits10 to digits2 conversions.

[SVN r80112]
2012-08-21 14:42:15 +00:00
John Maddock
b892e3f5ab Big breaking change - make lossy construction explicit.
[SVN r80058]
2012-08-16 08:13:51 +00:00
John Maddock
e2ef393c23 Big search and replace rename, removing mp_ prefix.
[SVN r79932]
2012-08-08 18:14:50 +00:00
John Maddock
19ee491c55 Add noexcept support/markup where possible.
[SVN r79331]
2012-07-07 11:16:28 +00:00
John Maddock
ebd7502fdc Enhance pow and powm tests.
Quash some warnings.
Fix the IO tests on GCC.

[SVN r78423]
2012-05-11 17:19:13 +00:00
John Maddock
a8c73aea66 Change non-member functions to be protected by enable_if based on the type of the number.
Extend expression templates to 4 arguments.
Add pow and powm functions for integer types.
Update docs to match.

[SVN r78401]
2012-05-10 09:20:26 +00:00
John Maddock
4c6065717b Add a few more integer specific bit-fiddling functions.
Fix some bugs in cpp_int left shift code.
Document some missing backend API's, and update docs.

[SVN r77583]
2012-03-27 11:45:01 +00:00
John Maddock
24cff33935 Update Miller Rabin test to use small prime filtering.
Add some new integer type operations.
Update performance tests to match.

[SVN r77451]
2012-03-21 09:19:57 +00:00
John Maddock
2349943cdb Fix some GMP int errors, and simplify modulus code.
Fix some cpp_int errors.
Improve cpp_int tests.

[SVN r77362]
2012-03-17 19:43:26 +00:00
John Maddock
b42208c5df Fix several division algorithm bugs.
Add cpp_rational to performance tests.
Add modular arithmetic test to test cases.

[SVN r77303]
2012-03-11 16:43:31 +00:00
John Maddock
5500ad3ea8 Add support for fixed precision and unsigned cpp_int's.
[SVN r77260]
2012-03-08 10:34:37 +00:00
John Maddock
bea3707326 Add initial version of an arbitrary precision integer type.
Hook up some more fixed_int tests.

[SVN r77141]
2012-02-29 13:05:51 +00:00