Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. double cfrac_tan(double x, unsigned int n)
  2. {
  3. double vysledok = 0.0;
  4. double citatel = x*x;
  5. int cislo = (2*n)-1;
  6.  
  7. while (cislo > 1)
  8. {
  9. vysledok = citatel/(cislo - vysledok);
  10. cislo -= 2;
  11. }
  12. if (cislo == 1)
  13. {
  14. vysledok = x/(1 - vysledok);
  15. }
  16. printf("%e\n",vysledok);
  17. return EXIT_SUCCESS;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement