Is there a variable type function in java? I need to be able to deal with functions like matlab does.
For example:
Then evaluate the function at a point, for example:Code:function x = "X^2";
Is this possible?Code:x(10);
Thanks.
Printable View
Is there a variable type function in java? I need to be able to deal with functions like matlab does.
For example:
Then evaluate the function at a point, for example:Code:function x = "X^2";
Is this possible?Code:x(10);
Thanks.
What's wrong with doing:
Greetings.Code:public double f(double x) {
return x*x;
}
System.out.println(f(10));