MCPcopy Create free account
hub / github.com/Aghajari/MathParser / factorial

Method factorial

MathParser/src/com/aghajari/math/Functions.java:272–279  ·  view source on GitHub ↗
(double x)

Source from the content-addressed store, hash-verified

270 }
271
272 public static double factorial(double x) {
273 int number = (int) x;
274 long result = 1;
275 for (int factor = 2; factor <= number; factor++) {
276 result *= factor;
277 }
278 return result;
279 }
280
281 // ignore Math.log as base e
282 public static double log(double a) {

Callers 1

cMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected