Advertisement
smatskevich

Seminar1

Jan 17th, 2025
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <algorithm>
  2. #include <array>
  3. #include <cassert>
  4. #include <climits>
  5. #include <cmath>
  6. #include <cstring>
  7. #include <iomanip>
  8. #include <iostream>
  9. #include <limits>
  10. #include <list>
  11. #include <map>
  12. #include <numeric>
  13. #include <numbers>
  14. #include <queue>
  15. #include <set>
  16. #include <sstream>
  17. #include <stack>
  18. #include <string>
  19. #include <tuple>
  20. #include <unordered_map>
  21. #include <unordered_set>
  22. #include <vector>
  23.  
  24. #define all(x) x.begin(), x.end()
  25. using namespace std;
  26. using ll = long long;
  27. using ld = long double;
  28. const double eps = 1e-10;
  29. const int mod = 1000000007;
  30.  
  31. void Solve() {
  32.   float l = 0., r = 1.;
  33.   for (int i = 0; i < 100; ++i) {
  34.     float m = (l + r) / 2.;
  35.     if (m + m == 0.0f)
  36.       l = m;
  37.     else
  38.       r = m;
  39.   }
  40.   cout << setprecision(10) << l << "\n";
  41. }
  42.  
  43. void Angles() {
  44.   cout << setprecision(40) << fixed;
  45.   cout << M_PI << "\n";
  46.   cout << acosl(-1.) << " " << abs(acosl(-1.) - M_PI) << "\n";
  47.   cout << atan2l(0., -1.) << " " << abs(atan2l(0., -1.) - M_PI) << "\n";
  48.   cout << std::numbers::pi_v<ld> << "\n";
  49. }
  50.  
  51. int main() {
  52.   ios::sync_with_stdio(false);
  53.   cin.tie(nullptr);
  54.   cout.tie(nullptr);
  55.  
  56.   Angles();
  57.   return 0;
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement