fork(2) download
  1. #include <iostream>
  2. #include <limits>
  3. #include <iomanip>
  4. int main()
  5. {
  6. long double x = 1.123456789L;
  7. std::cout << "default precision: " << x << '\n'
  8. << "max precision: " << std::setprecision(std::numeric_limits<long double>::digits10) << x << '\n';
  9. }
  10.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
default precision: 1.12346
max precision: 1.123456789