Description

Provides a mathematical expression evaluator. Mathematical expressions can be passed to it as a string, and solved. This allows mathematical expressions to be stored as strings, and be generated or altered at run-time.

Usage guide and support: https://meseta.itch.io/gm-expreval

Basic Usage In the most basic usage, variables are loaded into the a new expreval, and an expression is evaluated. The output variables can then be read.

// create expression
var eval = expreval_create();

// set up variables
expreval_write_variable(eval, "a", 123);

// evaluate expression (intermediate variables are created automatically
expreval_evaluate(eval, "b=2*a;c=sin(b)");

// grab output variables
var retval = expreval_read_variable(eval, "c");
show_debug_message("Returned value: " + string(retval));
expreval_destroy(eval);

Multiple expressions can be evaluated, by separating them with a semicolon in the expression string.

Any temporary or output variables used in the expression will be automatically created, and made available for reading. Referencing an undefined variable will cause an error.

exprevals must be destroyed after they are no longer used to avoid a memory leak.

End User Licence Agreement (EULA).

Version 1.2.0. Published May 28, 2018

Age Rating: 4+

Average Rating

This asset hasn't received enough reviews yet.

Your review

You can only review assets you've bought.


Gravatar

Ata N 10 October 2018

Ah Mathematics...

This is really nice to have an expression evaluator for solving complex formulae !

Thanks!

Package contents

Loading, please wait

What is the issue?

Back to Top