Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Logaritm
- {
- using System;
- class Task122I
- {
- static void Main(string[] args)
- {
- double x = double.Parse(Console.ReadLine());
- double epsilon = double.Parse(Console.ReadLine());
- double etalon = Math.Log(x);
- int n = 1;
- double sum = 0;
- while (Math.Abs(etalon - sum) > epsilon)
- {
- sum += 2 * (1.0 / (2 * n - 1)) * Math.Pow((x - 1.0) / (x + 1.0), 2 * n - 1);
- n++;
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement