I have the following method:
static double NewtonMethodModified(Func<double, double> f, double x0, double h) { ... }
Now, I'd like to know how to call it the following way:
NewtonMethodModified(<lambda expression here>, 1.0, 1.0);
I'd guess this should be something like
NewtonMethodModified(x => 10x-5, 1.0, 1.0);
but it doesn't seem to work.
asked Nov 1, 2009 at 10:00
devoured elysium
106k134 gold badges358 silver badges576 bronze badges
1 Answer 1
That should already work - just add a * (it still uses C#-style operators, not implicit math operations such as "10x === 10 * x"):
NewtonMethodModified(x => 10*x-5, 1.0, 1.0);
answered Nov 1, 2009 at 10:02
Marc Gravell
1.1m273 gold badges2.6k silver badges3k bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-cs