Fast (limited) user defined recursion

MathParser.org - mXparser - logo - Tutorial

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

JAVA code

Case 1: Fibonacci numbers using fast recursion

import org.mariuszgromada.math.mxparser.*;
...
RecursiveArgument fib = new RecursiveArgument("fib(n) = fib(n-1) + fib(n-2)");
fib.addBaseCase(0, 0);
fib.addBaseCase(1, 1);
Expression e = new Expression("fib(10)", fib);
		
mXparser.consolePrintln("Res 1: " + e.getExpressionString() + " = " + e.calculate());
mXparser.consolePrintln("Res 2: fib(11) = " + fib.getArgumentValue(11));
Res 1: fib(10) = 55.0
Res 2: fib(11) = 89.0

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

Enjoy! 🙂

 

Best regards,

Mariusz Gromada

Download latest release – v.4.4.0 Gemoni: bin + doc + src (.zip 12.2 MB)

Download latest release – v.4.4.0 Gemoni: bin only (.zip 10 MB): includes separate binaries for various .NET platforms and Java versions

Source code .zipSource code .tar.gz View on GitHubMathSpace.pl