}
```</pre>
</div>
-<div created="20160816212627236" creator="lh3" modified="20160816214112990" modifier="lh3" tags="[[Library Documentations]]" title="Kexpr: parsing mathematical expressions">
+<div created="20160816212627236" creator="lh3" modified="20160816214517684" modifier="lh3" tags="[[Library Documentations]]" title="Kexpr: parsing mathematical expressions">
<pre>!!Synopsis
* Functionality: parse a mathematical expression with the [[Shunting-yard algorithm|https://en.wikipedia.org/wiki/Shunting-yard_algorithm]] and evaluate the final value. The library supports functions and variables.
* Library source code: [[kexpr.h|https://github.com/attractivechaos/klib/blob/master/kexpr.h]] and [[kexpr.c|https://github.com/attractivechaos/klib/blob/master/kexpr.c]]
ke_set_real(ke, "x", 1.0); // set the value of a variable
ke_set_real_func1(ke, "myexp", exp); // define a math function
printf("%g\n", ke_eval_real(ke, &err)); // compute the expression
+ ke_destroy(ke); // deallocate
return 0;
}
```