Advertisement
Guest User

lolleep

a guest
Feb 19th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. double myAtan(const double x){
  4. double un = x, sum = 0, temp = x;
  5. int k = 1;
  6.  
  7. while(abs(un) >= 0.000000595){
  8. sum += un;
  9. temp = temp * x * x;
  10. un = temp / (2 * k + 1);
  11. if(k % 2 != 0) un *= -1;
  12. ++k;
  13. }
  14. return sum;
  15. }
  16.  
  17. double myCos(const double x){
  18.  
  19.  
  20. }
  21.  
  22.  
  23.  
  24. int main(){
  25.  
  26. std::cout << myAtan(0.935);
  27.  
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement