Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double x,
- left = 0,
- right = 1,
- eps = 1e-4;
- do
- {
- x = (left + right) / 2;
- if ((Math.Cos(x) - x) * (Math.Cos(left) - left) < 0)
- right = x;
- else
- left = x;
- } while (Math.Abs(right - left) < eps);
- Console.WriteLine("Корень равен " + x);
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement