Advertisement
greedydev

Untitled

Sep 23rd, 2022
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. double ln(double x, double eps) {
  2.         double result = 0;
  3.         double current = 1;
  4.         int i = 1;
  5.         while (current > eps) {
  6.             result += current;
  7.             current *= -1 * (x - 1) / i;
  8.             i++;
  9.         }
  10.         return result;
  11.     }
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement