add besselj function

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897765 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-02-04 13:36:10 +00:00
parent d5641b3062
commit 39b134acae
2 changed files with 3 additions and 2 deletions

View File

@ -52,9 +52,9 @@ public final class BesselJ extends Fixed2ArgFunction implements FreeRefFunction
return ErrorEval.NUM_ERROR;
}
org.apache.commons.math3.special.BesselJ bes = new org.apache.commons.math3.special.BesselJ(order);
final double result = org.apache.commons.math3.special.BesselJ.value(order, xval);
return new NumberEval(bes.value(xval));
return new NumberEval(result);
} catch (EvaluationException e) {
return e.getErrorEval();
}

View File

@ -63,6 +63,7 @@ final class TestBesselJ {
double tolerance = 0.000001;
assertDouble(fe, cell, "BESSELJ(1.9, 2)", 0.329925829, tolerance);
assertDouble(fe, cell, "BESSELJ(1.9, 2.5)", 0.329925829, tolerance);
assertDouble(fe, cell, "BESSELJ(12.4,7)", -0.217156767, tolerance);
}
}