2

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

1 Answer 1

8

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.