Skip to content

Tags: BeardedManZhao/mathematical-expression-cpp

Tags

1.0.5

Update 1.0.4_1.0.5.md

1.0.4

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update README-Chinese.md

1.0.3

1.0.3发布

# ![image](https://user-images.githubusercontent.com/113756063/203919312-dcec4a61-2136-4af2-a361-66b2ed4e6a54.png) 数学表达式-cpp 更新日志

## 更新版本:1.0.2 -> 1.0.3

* 更新版本: 1.0.2 -> 1.0.3
* 更新时间: 2024年01月08日
* 参与更新任务的作者列表

| 名称             | GitHub主页                          | 联系方式              |
|----------------|-----------------------------------|-------------------|
| BeardedManZhao | https://github.com/BeardedManZhao | liming7887@qq.com |
| ------         | ------                            | ------            |

## 注意事项

1.0.2 以及 以后的版本中 针对函数的注册操作不能向后兼容,如果是在1.0.2版本以以后的版本 请使用下面的方式注册函数

```
    // 准备函数 这里的函数的作用是将 3 个参数求和
    auto myFun = [](const ME::MEStack<double>& v) {
        double res = 0;
        for (int i = 0; i < v.size(); ++i){
            res += v.get(i);
        }
        return res;
    };
    // 注册函数 将我们的函数注册成为 DoubleValue 的名称
    ME::FunctionManager::append("sum", myFun);
```

## 更新日志

在旧版本中,针对 `2*-1` 这类的计算操作会发生一些异常,因此在这里我们进行了修复,本次修复不会影响任何操作,也不会带来任何不良影响,下面是旧版本中出现错误的代码,本次更新将修复此问题。

```c++
#include <mathematical_expression.h>
#include "FunctionManager.h"
#include "Utils.h"
int main() {
    system("chcp 65001");
    // 构建一个数学表达式,表达式中使用到了函数 DoubleValue
    string s = "2 * -1";
    // 获取到 数学表达式解析库
    mathematical_expression me;
    // 获取到函数表达式计算组件
    auto functionFormulaCalculation = me.getPrefixExpressionOperation();
    // 检查数学表达式
    functionFormulaCalculation.check(s);
    // 计算出结果
    ME::CalculationNumberResults results = functionFormulaCalculation << s;
    // 将结果打印出来
    cout << "计算层数:" << results.getResultLayers() << "\t计算结果:" << results << "\t计算来源:" << results.getCalculationSourceName() << endl;
}
```

1.0.2

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Zhao (#4)

* 新增多参数函数表达式计算组件

* update

1.0.1.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1.0.1 版本小修复 (#2)

更新版本号冲突,并且增加注释

1.0.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Zhao - 1.0.1 版本更新 (#1)

* 开始1.0.1版本的开发任务

* 布尔运算表达式组件

* 新增布尔运算表达式计算组件
* 新增函数缓冲池

* 函数模块以及函数表达式解析

* 函数模块以及函数表达式解析的有关功能开始被支持。

* 1.0.1版本上传

1.0.0

1.0.0 版本上传