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

This commit is contained in:
Arash Partow
2016-08-18 18:51:21 +10:00
parent 79a3a265ec
commit 98761d3a94
4 changed files with 273 additions and 62 deletions

View File

@ -44,8 +44,8 @@ void primes()
.add(
function_t(
"is_prime_impl1",
"if(y == 1,true, "
" if(0 == (x % y),false, "
"if (y == 1,true, "
" if (0 == (x % y),false, "
" is_prime_impl1(x,y - 1)))",
"x","y"));
@ -53,8 +53,8 @@ void primes()
.add(
function_t(
"is_prime1",
"if(frac(x) != 0, false, "
" if(x <= 0, false, "
"if (frac(x) != 0, false, "
" if (x <= 0, false, "
" is_prime_impl1(x,min(x - 1,trunc(sqrt(x)) + 1))))",
"x"));