Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/cstdfloat.hpp> // For float_64_t, float128_t. Must be first include!
- #include <boost/math/special_functions/gamma.hpp>
- #include <cmath>
- #include <stdlib.h>
- #include <cinttypes>
- #include <iostream>
- int main()
- {
- boost::float128_t b = 2;
- //std::cout << std::numeric_limits<float128_t>::digits << std::endl;
- std::cout.precision(std::numeric_limits<boost::float128_t>::digits10);
- //std::cout << std::numeric_limits<float128_t>::digits10 << std::endl;
- std::cout.setf(std::ios_base::showpoint); // Include any trailing zeros.
- std::cout.precision(std::numeric_limits<boost::float128_t>::digits10);
- std::cout<< log(b) << std::endl; // Shows log(2) = 0.693147180559945309417232121458176575
- std::cout << boost::math::tgamma(b) << std::endl;
- //std::numeric_limits<float128_t>::max_digits10 = 36
- //boost::float128_t pi = 3.14159265358979323846264338327950288Q;
- constexpr boost::float128_t pi = 3.14159265358979323846264338327950288Q;
- std::cout << "pi = " << pi << std::endl; //pi = 3.14159265358979323846264338327950280
- }
Advertisement
Add Comment
Please, Sign In to add comment