Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Jan 7, 2022
1 parent 2d2cb45 commit 38dd205
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* 【core 】 修复NamingCase中转换下划线字母+数字转换问题(issue#2070@Github)
* 【core 】 修复split空判断不一致问题(pr#496@Gitee)
* 【crypto 】 修复SM2.getDHex()前导0丢失,然后导致获取密钥错误(pr#2073@Github)
* 【core 】 修复关于Calculator.conversion()方法EmptyStackException的bug(pr#2076@Github)

-------------------------------------------------------------------------------------------------------------
# 5.7.18 (2021-12-25)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cn.hutool.core.math;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

public class CalculatorTest {
Expand Down Expand Up @@ -42,4 +41,11 @@ public void conversationTest6() {
final double conversion = Calculator.conversion("-((2.12-2) * 100)");
Assert.assertEquals(-1D * (2.12 - 2) * 100, conversion, 2);
}

@Test
public void conversationTest7() {
//https://gitee.com/dromara/hutool/issues/I4KONB
final double conversion = Calculator.conversion("((-2395+0) * 0.3+140.24+35+90)/30");
Assert.assertEquals(-15.11, conversion, 2);
}
}

0 comments on commit 38dd205

Please sign in to comment.