Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //REF https://en.cppreference.com/w/cpp/io/manip/setprecision
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <limits>
- int main() {
- const long double pi = std::acos(-1.L);
- std::cout << "default precision (6): " << pi << '\n'
- << "Novamente, sem set precision " << pi << '\n'
- << "max precision: "
- << std::setprecision(std::numeric_limits<long double>::digits10 + 1)
- << pi << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement