Skip to content

Commit 492f20f

Browse files
committed
Some correction for compilation.
1 parent a0629ed commit 492f20f

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

src_number/NumberTheoryBoostCppInt.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,6 @@ bool universal_square_root(boost::multiprecision::cpp_rational &ret,
574574
return true;
575575
}
576576

577-
#include "NumberTheoryGeneric.h"
578-
#include "TypeConversionFinal.h"
579-
580577
// clang-format off
581578
#endif // SRC_NUMBER_NUMBERTHEORYBOOSTCPPINT_H_
582579
// clang-format on

src_number/NumberTheoryBoostGmpInt.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,6 @@ bool universal_square_root(boost::multiprecision::mpq_rational &ret,
562562
return true;
563563
}
564564

565-
#include "NumberTheoryGeneric.h"
566-
#include "TypeConversionFinal.h"
567-
568565
// clang-format off
569566
#endif // SRC_NUMBER_NUMBERTHEORYBOOSTGMPINT_H_
570567
// clang-format on

src_number/Test_TypeBoostGmp.cpp

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Copyright (C) 2022 Mathieu Dutour Sikiric <mathieu.dutour@gmail.com>
2+
23
// clang-format off
34
#include "NumberTheoryBoostGmpInt.h"
5+
#include "NumberTheoryBoostCppInt.h"
6+
#include "NumberTheoryCommon.h"
47
#include "ResidueQuotient.h"
58
// clang-format on
69

7-
int main() {
8-
9-
using T = boost::multiprecision::mpq_rational;
10-
using Tint = boost::multiprecision::mpz_int;
11-
12-
T val1, val2;
10+
template<typename Trat, typename Tint>
11+
void test_trat_tint() {
12+
Trat val1, val2;
1313
val1 = 2;
1414
val2 = 5;
15-
T val = val1 / val2;
15+
Trat val = val1 / val2;
1616
std::cerr << "val=" << val << "\n";
17-
Tint val_red = UniversalNearestScalarInteger<Tint, T>(val);
17+
Tint val_red = UniversalNearestScalarInteger<Tint, Trat>(val);
1818
std::cerr << "val_red=" << val_red << "\n";
1919
//
2020
using Tlong = int64_t;
@@ -23,3 +23,19 @@ int main() {
2323
Tlong lcm = LCMpair(val3, val4);
2424
std::cerr << "lcm=" << lcm << "\n";
2525
}
26+
27+
28+
29+
int main() {
30+
{
31+
using Trat = boost::multiprecision::mpq_rational;
32+
using Tint = boost::multiprecision::mpz_int;
33+
test_trat_tint<Trat,Tint>();
34+
}
35+
//
36+
{
37+
using Trat = boost::multiprecision::cpp_rational;
38+
using Tint = boost::multiprecision::cpp_int;
39+
test_trat_tint<Trat,Tint>();
40+
}
41+
}

0 commit comments

Comments
 (0)