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.1.1 Aeries: bin + doc + src (.zip 13.4 MB)

Download latest release – v.4.1.1 Aeries: bin only (.zip 4.35 MB) – separate binaries for java: 1.5, 1.6, 1.7, 1.8; .NET: 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.7, .NET Core, .NET Standard, .NET PCL, Xamarin.Android, Xamarin.iOS

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