java
Antegral antegral = new Antegral(new IFunc() {
@Override
public double func(double input) {
// defind function here
return 4 * input;
}
});
antegral.calcute(0, 2); // this will return Area
python3
import Antegral
# put your function here
def func(input):
return input*2
sum = Antegral.Calculate(0,2,func)
js
var antegral = require("./Antegral");
var sum = antegral.calcute(0, 2,
function (x) {
return 2 * x;//put your function here
}
);
java
Derivation derivation = new Derivation(new IFunc() {
@Override
public double func(double input) {
return input * input;
}
});
derivation.calcute(10);
python3
import Derivation
# put your function here
def func(input):
return input*2
sum = Derivation.Calculate(10,func)
js
var derivation = require("./Derivation");
var an = derivation.calcute(10,(x)=>{
//your function here
return x*x;
});
function : 2x ,
start : 0 ,
end : 2
python: 0.162s
javascript: 0.457s
java: 0.095s
right answer : 4
program answer : 4.00002