1
0
mirror of https://github.com/ArashPartow/exprtk.git synced 2025-07-18 03:17:28 +00:00

C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow
2014-05-31 07:38:57 +10:00
parent 6b86ec0deb
commit 1bf1073cd8
8 changed files with 145 additions and 38 deletions

@ -32,12 +32,15 @@ void fibonacci()
compositor_t compositor;
compositor
.add("fibonacci_impl",
"switch "
"{ "
" case x == 0 : 0; "
" case x == 1 : 1; "
" default : "
.add("fibonacci",
" var w := 0; "
" var y := 0; "
" var z := 1; "
" switch "
" { "
" case x == 0 : 0; "
" case x == 1 : 1; "
" default : "
" while ((x -= 1) > 0) "
" { "
" w := z; "
@ -45,12 +48,7 @@ void fibonacci()
" y := w; "
" z "
" }; "
"} ",
"x","y","z","w");
compositor
.add("fibonacci",
"fibonacci_impl(x,0,1,0)",
" } ",
"x");
T x = T(0);