| 1 | #include <iostream>
|
|---|
| 2 | #include <utility>
|
|---|
| 3 |
|
|---|
| 4 | #include <boost/math/constants/constants.hpp>
|
|---|
| 5 | #include <boost/multiprecision/cpp_bin_float.hpp>
|
|---|
| 6 |
|
|---|
| 7 | using boost::multiprecision::cpp_bin_float_single;
|
|---|
| 8 | using boost::multiprecision::cpp_bin_float_double;
|
|---|
| 9 |
|
|---|
| 10 | typedef boost::multiprecision::cpp_bin_float_single f32;
|
|---|
| 11 | typedef boost::multiprecision::cpp_bin_float_double f64;
|
|---|
| 12 |
|
|---|
| 13 | int main(void)
|
|---|
| 14 | {
|
|---|
| 15 | #if BUGTEST_PRECISION == 32
|
|---|
| 16 | //f32 pi32 = boost::math::constants::pi<f32, boost::math::policies::policy<boost::math::policies::digits2<32> > >();
|
|---|
| 17 | f32 pi32 = boost::math::constants::pi<f32>();
|
|---|
| 18 | std::cout << pi32 << std::endl;
|
|---|
| 19 | #elif BUGTEST_PRECISION == 64
|
|---|
| 20 | //f64 pi64 = boost::math::constants::pi<f64, boost::math::policies::policy<boost::math::policies::digits2<64> > >();
|
|---|
| 21 | f64 pi64 = boost::math::constants::pi<f64>();
|
|---|
| 22 | std::cout << pi64 << std::endl;
|
|---|
| 23 | #else
|
|---|
| 24 | #error Set BUGTEST_PRECISION to 32 or 64.
|
|---|
| 25 | #endif
|
|---|
| 26 | return 0;
|
|---|
| 27 | }
|
|---|