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

This commit is contained in:
Arash Partow
2020-01-01 00:00:00 +00:00
parent f32d2b4bbb
commit e67b22afd9
25 changed files with 3701 additions and 1792 deletions

View File

@ -3,7 +3,7 @@
* C++ Mathematical Expression Toolkit Library *
* *
* Simple Example 14 *
* Author: Arash Partow (1999-2018) *
* Author: Arash Partow (1999-2020) *
* URL: http://www.partow.net/programming/exprtk/index.html *
* *
* Copyright notice: *
@ -18,6 +18,7 @@
#include <cstdio>
#include <string>
#include "exprtk.hpp"
@ -27,7 +28,7 @@ void stddev_example()
typedef exprtk::expression<T> expression_t;
typedef exprtk::parser<T> parser_t;
std::string stddev_program =
const std::string stddev_program =
" var x[25] := { "
" 1, 2, 3, 4, 5, "
" 6, 7, 8, 9, 10, "
@ -43,7 +44,7 @@ void stddev_example()
parser_t parser;
parser.compile(stddev_program,expression);
T stddev = expression.value();
const T stddev = expression.value();
printf("stddev(1..25) = %10.6f\n",stddev);
}