Commit Graph

105 Commits

Author SHA1 Message Date
jzmaddock
b63b6fe7fe Add enhanced tests for rational number construct and assign.
Fix the errors that result in rational_adaptor and gmp.
2022-04-28 17:59:47 +01:00
Matt Borland
78e2be1a6d Conditionally disable math usage in default_ops 2022-02-22 11:43:03 +01:00
Matt Borland
cb537aa47a Add standalone implementation of lltrunc 2022-02-11 14:38:21 +01:00
jzmaddock
150cf95712 Stop relying on if constexpr in new test case. 2022-01-23 09:17:37 +00:00
jzmaddock
4bfdc1bae1 Fix some mpq rational arithmetic errors:
Multiplication by zero should not proceed via gcd.
Multiplication by scalar should be restricted to integer types (not floats).
Add some more tests to catch these cases.
2022-01-22 18:34:09 +00:00
Matt Borland
2e067d2d76 Disable lexical_cast in standalone mode 2022-01-08 09:47:05 +02:00
Matt Borland
c7cbbbd840 Fix macro error from rebase 2022-01-07 14:10:30 +02:00
Matt Borland
50957704b3 Revert "Revert "Merge pull request #403 from mborland/standalone_fixes""
This reverts commit 04b327b24f.
2022-01-06 20:37:43 +02:00
jzmaddock
bcd095c125 Remove more typeid uses for __int128. 2022-01-05 18:10:05 +00:00
jzmaddock
91f6f2b370 Stop using typeid on __int128/__float128
as it leads to linker errors on some platforms.
2022-01-05 09:11:55 +00:00
jzmaddock
d78e4ba6ad Correct conversion operators so they work in non gnu mode.
Use typedefs for __int128 and __float128 throughout.
Remove lexical tommath conversions in favour of "proper" conversion operators.
2022-01-02 10:49:00 +00:00
jzmaddock
521ab46cbc Implement conversions to and from __in128 and __float128.
Add tests to test_arithmetic.hpp.
Strengthened up conversion/assignment operators with enable_if as required, so that unsupported conversions lead to errors at the top level (when looking for the operator in class number), rather than deep inside our template code.
Fixes: https://github.com/boostorg/multiprecision/issues/237.
2021-12-28 19:11:34 +00:00
Matt Borland
d77c23842b Missing header for standalone tests 2021-11-26 21:41:39 +02:00
jzmaddock
6d4cd18f02 Update for better interoperability of rationals and integers.
Fix generic_interconvert.hpp for unsigned types.
Update performance testing code to include testing with ::value_type.
Start testing unsigned and checked integer types with rational_adaptor.
Update arithmetic tests to test mixed arithmetic with ::value_type.
2021-09-15 13:16:49 +01:00
jzmaddock
db3007352b Correct mpq_rational conversion to integer.
Fixes https://github.com/boostorg/multiprecision/issues/342.
2021-07-06 12:46:44 +01:00
jzmaddock
897bcb4165 Fix up conversions to and from enum's and add new tests.
Fixes: https://github.com/boostorg/multiprecision/issues/324.
2021-06-04 13:43:58 +01:00
jzmaddock
a9b4361c0a Completely remove MPL usage. 2021-01-16 11:22:28 +00:00
jzmaddock
771985f06b Finish off removing pretty much all of type_traits usage. 2021-01-14 19:25:54 +00:00
jzmaddock
8bb54d07fd Remove most boost.type_traits usage. 2021-01-14 17:05:14 +00:00
jzmaddock
cb514e9249 Giant C++11 refactor removing:
BOOST_STATIC_ASSERT
BOOST_STATIC_CONST
boost::enable_if/disable_if
Changed many traits class usages from boost:: to std::.
2021-01-13 14:33:48 +00:00
jzmaddock
05d2d09bfd Remove tons of C++03 workarounds. 2021-01-11 21:42:50 +00:00
jzmaddock
9d91041e93 Remove rvalue workarounds. 2021-01-11 19:03:46 +00:00
jzmaddock
b51516a1a3 Correct spelling of BOOST_NO_LONG_LONG.
Fixes https://github.com/boostorg/multiprecision/issues/269.
2020-09-04 09:22:27 +01:00
jzmaddock
ed66aa5469 Improve accuracy of complex tan/tanh.
Test self assignment when using complex_adaptor and fix resulting bugs.
Fixes https://github.com/boostorg/multiprecision/issues/262.
2020-08-06 21:54:49 +01:00
jzmaddock
e6289f9603 Lehmer gcd: add test case to validate fixed precision checked arithmetic support. 2020-06-14 17:24:34 +01:00
jzmaddock
64fbcd673c Add better test coverage for new RValue ref overloads. 2020-03-19 18:45:33 +00:00
John Maddock
684b232782 More waring fixes for gcc and clang 2019-10-24 21:39: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
Tinko Bartels
8740e3863b Replace broken links. 2019-04-23 08:51:47 +02:00
jzmaddock
7f5594c15c Merge pull request #82 from boostorg/APPoS
Apply "Assignment Preserves Precision of Source".
2018-09-16 19:21:36 +01:00
jzmaddock
8d281cc47f Apply "Assignment Preserves Precision of Source".
APPoS for short, throughout the library including in mixed precision arithmetic which should now always promote to the highest precision of any of the arguments.
2018-09-06 20:37:56 +01:00
jzmaddock
27c80085b1 Merge branch 'develop' into issue66 2018-08-18 10:37:39 +01:00
jzmaddock
5daa4e2fa7 Fix overloads of binary functions to allow mixed types in expression templates.
For example complex+real expression.
Mixed expression+expression is not currently supported (it's complicated!).
Fixes: https://github.com/boostorg/multiprecision/issues/69.
2018-08-18 09:36:04 +01:00
jzmaddock
314383dab9 string_view support:
Fix tests that aren't testing number (but boost::rational).
Add assignment support.
See https://github.com/boostorg/multiprecision/issues/66
2018-08-17 09:09:38 +01:00
jzmaddock
15330801e0 Add support for construction from a std::string_view.
See https://github.com/boostorg/multiprecision/issues/66.
2018-08-16 20:11:10 +01:00
jzmaddock
d5c7a7f701 Fix string parsing of complex types and update tests. Fixes https://github.com/boostorg/multiprecision/issues/59 2018-08-05 20:38:51 +01:00
jzmaddock
bbe819f803 Conversion of between unsigned ints should be truncating. 2018-05-16 21:26:08 +01:00
jzmaddock
aff777636d Merge pull request #48 from boostorg/shift_negative
Remove warning on shifting negative value.
2018-05-11 19:08:26 +01:00
jzmaddock
73de592835 complex: re-enable some MPC specific tests. 2018-04-17 18:51:13 +01:00
jzmaddock
c1308b5cf1 Complex: Lot's of small updates to complete complex_adaptor and tests. 2018-04-17 18:49:09 +01:00
jzmaddock
7eee55776e complex: add complex_adaptor plus first tests. 2018-04-13 19:25:15 +01:00
jzmaddock
e6989777cf complex/mpc: Add overloads of real/imag setters for all the types supported by mpfr. 2018-03-31 11:34:49 +01:00
jzmaddock
24cb1375fd mpc/complex: Add real/imag setters.
[CI SKIP]
2018-03-31 11:09:29 +01:00
jzmaddock
c68e8076b8 Complex/mpc: another try at fixing up the 2 argument constructor.
[CI SKIP]
2018-03-22 14:54:13 +00:00
jzmaddock
1a32ade24c Complex/mpc: Add support for 2-arg construction from args of different types.
Add first cut at Eigen compatibility test suite.
2018-03-21 20:10:21 +00:00
jzmaddock
04b1191732 complex/mpc: add support for interconversions to and from std::complex. 2018-03-18 17:33:28 +00:00
jzmaddock
4196c6ae62 Complex: Add support for single argument polar().
Update unary functions to handle case where we're creating a result type which is not the same as the function result type - for example when dealing with mixed scalar and complex arithmetic.
2018-03-17 19:08:36 +00:00
Nick Thompson
2144154954 Use literal ints rather than shifted negative values. 2018-03-17 15:23:34 +08:00
jzmaddock
8d2bd0a1d3 complex/mpc: Add value_type to class number, and overloads for polar function.
Split up one concept check that was generating over-large object file sizes.
2018-03-16 20:12:06 +00:00