Untitled

mail@pastecode.io avatar
unknown
csharp
2 years ago
402 B
4
Indexable
using static System.Math;

namespace LTE.Helpers;

public class MathHelpers
{
    public static double Lim(Func<double, double> func)
    {
        var x = 1;
        
        var ax = 1.0;
        var ax1 = 2.0;
        
        while (Abs(ax1 - ax) > Pow(10, -1000))
        {
            ax = func(x);
            ax1 = func(++x);
        }
        
        return ax;
    }
}