Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- double myAtan(const double x){
- double un = x, sum = 0, temp = x;
- int k = 1;
- while(abs(un) >= 0.000000595){
- sum += un;
- temp = temp * x * x;
- un = temp / (2 * k + 1);
- if(k % 2 != 0) un *= -1;
- ++k;
- }
- return sum;
- }
- double myCos(const double x){
- }
- int main(){
- std::cout << myAtan(0.935);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement