Contents
ExprTk interpreter
In Nift's interpreter mode the prompt will just display the language. If you would like the prompt to also display the present working directory (up to using half the width of the console) you can switch to the shell mode using
You can switch to one of the other languages available in Nift's interpreter using
Running ExprTk scripts
If you have an
nsm run path/script-name.exprtk nift run path/script-name.exprtk
If the script has a different extension, say
nsm run -exprtk path/script-name.ext nift run -exprtk path/script-name.ext
ExprTk from f++
You can run
exprtk(expression)
`expression`
exprtk { // block of ExprTk code }
ExprTk from n++
You can run
@exprtk(expression)
@`expression`
@exprtk { // block of ExprTk code }
ExprTk with f++ /N++ conditions
You can use
for(int i=0; i<10; i+=1) console("i: ", i)
ExprTk access to Nift variables
Nift functions
The following functions specific to
syntax | example | about |
---|---|---|
change directory | ||
execute system call/command | ||
convert double to string | ||
set Nift variable from number | ||
set Nift variable from string | ||
get number from Nift variable | ||
get string from Nift variable | ||
write to console, output file (ofile), or a stream | ||
syntax | example | about |
Benchmark results
Results from The Great C++ Mathematical Expression Parser Benchmark are below:
Scores: # Parser Type Points Score Failures ----------------------------------------------------------------------- 00 ExprTk double 901 100 0 01 ExprTkFloat float 740 82 9 02 muparserSSE float 726 93 9 03 METL double 686 52 0 04 FParser 4.5 double 584 43 0 05 atmsp 1.0.4 double 530 38 2 06 muparser 2.2.4 double 517 37 0 07 muparser 2.2.4 (omp) double 444 35 0 08 MTParser double 381 34 0 09 MathExpr double 360 29 2 10 TinyExpr double 354 31 2 11 Lepton double 134 8 2 12 muparserx double 86 5 0