Monday, September 5, 2011

Interpretieren und Rechnen - Vala binding for libmatheval.

libmatheval is small library of procedures for evaluating mathematical functions.
The appropriate vapi to use this library from vala can be found around the corner.
The usage of libmatheval is quite easy, here an example:
#!/usr/bin/vala --pkg libmatheval
using matheval;
void main ()
{
    var e = Evaluator.create ("x + y^2");
    print("e.evaluate_x:\t%s = %g\t\t| x = 4\n", 
        e.get_string(), e.evaluate_x (4));
}
More functions calls can be found here.

No comments:

Post a Comment