You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A powerful C++ mathematical expression parser library with support for complex numbers, matrices, strings, date/time operations, and 60+ built-in functions. Originally based on muParserX by Ingo Berg, this library provides comprehensive mathematical expression evaluation capabilities.
🚀 Key Features
✅ 60+ Built-in Functions - Comprehensive mathematical function library
✅ Multiple Data Types - Numbers, Complex, Strings, Matrices, Arrays
graph TB
subgraph "Expression Parser Architecture"
A[Expression String] --> B[Tokenizer]
B --> C[RPN Converter]
C --> D[Expression Tree]
D --> E[Evaluator]
E --> F[Result Value]
subgraph "Package System"
G[Common Package]
H[Math Package]
I[String Package]
J[Matrix Package]
K[Date/Time Package]
end
D --> G
D --> H
D --> I
D --> J
D --> K
end
// Ternary operations"5 > 3 ? 'yes' : 'no'"// Result: "yes""x = 10; x > 5 ? x * 2 : x / 2"// Result: 20
Complex Expressions
// Multi-line expressions"""x = 5y = 3result = x > y ? sqrt(x^2 + y^2) : abs(x - y)result"""// Result: 5.831 (hypotenuse)// Nested function calls"round_decimal(sin(pi/4) * 100, 2)"// Result: 70.71
📊 Supported Data Types
graph LR
subgraph "Value System"
A[Value Type] --> B[Float]
A --> C[Integer]
A --> D[Complex]
A --> E[String]
A --> F[Boolean]
A --> G[Matrix]
A --> H[Array]
end
B --> I[Mathematical Operations]
C --> I
D --> J[Complex Mathematics]
E --> K[String Operations]
F --> L[Logical Operations]
G --> M[Matrix Operations]
H --> N[Array Operations]
Loading
🚀 Integration Examples
C++ Usage
#include"equationsParser.h"// Basic evaluation
std::string result = EquationsParser::Calc("sin(pi/2)");
// result = "1"// JSON response with type information
std::string jsonResult = EquationsParser::CalcJson("sqrt(16)");
// jsonResult = {"val":"4","type":"f"}
New functions: cbrt, hypot, pow for complex numbers
4.0.0
2015-06-22
Major API changes, removed integer constructors
3.0.0
2014-05-25
C++11 required, array construction {1,2,3}, matrix functions
2.1.0
2011-10-16
Matrix data type, multidimensional index operator
📜 License
This library is distributed under the BSD-2-Clause License ("Simplified" or "FreeBSD" License).
Copyright (C) 2016, Ingo Berg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.