1 | #include <iostream>
|
---|
2 | #include <boost/multiprecision/cpp_bin_float.hpp>
|
---|
3 |
|
---|
4 |
|
---|
5 | typedef boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<128, boost::multiprecision::backends::digit_base_2> > ext_float_t;
|
---|
6 |
|
---|
7 | int main(int, char**) {
|
---|
8 | ext_float_t a("1e500000000");
|
---|
9 | ext_float_t aa = a*a; // +inf
|
---|
10 | ext_float_t m1 = -1;
|
---|
11 |
|
---|
12 | std::cout
|
---|
13 | << aa << " * " << m1 << " = " << aa*m1 << "\n"
|
---|
14 | << m1 << " * " << aa << " = " << m1*aa << "\n"
|
---|
15 | << aa << " / " << m1 << " = " << aa/m1 << "\n"
|
---|
16 | ;
|
---|
17 |
|
---|
18 | return 0;
|
---|
19 | }
|
---|