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

This commit is contained in:
ArashPartow
2024-01-01 00:00:00 +00:00
committed by Arash Partow
parent f46bffcd69
commit cc1b800c2b
33 changed files with 67415 additions and 54230 deletions

View File

@ -3,7 +3,7 @@
* C++ Mathematical Expression Toolkit Library *
* *
* Simple Example 11 *
* Author: Arash Partow (1999-2023) *
* Author: Arash Partow (1999-2024) *
* URL: https://www.partow.net/programming/exprtk/index.html *
* *
* Copyright notice: *
@ -11,6 +11,7 @@
* permitted under the guidelines and in accordance with the *
* most current version of the MIT License. *
* https://www.opensource.org/licenses/MIT *
* SPDX-License-Identifier: MIT *
* *
**************************************************************
*/
@ -30,12 +31,14 @@ void square_wave2()
typedef exprtk::parser<T> parser_t;
const std::string wave_program =
" var r := 0; "
" for (var i := 0; i < 1000; i += 1) "
" { "
" r += (1 / (2i + 1)) * sin((4i + 2) * pi * f * t); "
" }; "
" r *= a * (4 / pi); ";
" var r := 0; "
" "
" for (var i := 0; i < 1000; i += 1) "
" { "
" r += (1 / (2i + 1)) * sin((4i + 2) * pi * f * t); "
" }; "
" "
" r *= a * (4 / pi); ";
static const T pi = T(3.141592653589793238462643383279502);