Skip to content

Commit 38dd205

Browse files
committed
fix bug
1 parent 2d2cb45 commit 38dd205

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* 【core 】 修复NamingCase中转换下划线字母+数字转换问题(issue#2070@Github)
2525
* 【core 】 修复split空判断不一致问题(pr#496@Gitee)
2626
* 【crypto 】 修复SM2.getDHex()前导0丢失,然后导致获取密钥错误(pr#2073@Github)
27+
* 【core 】 修复关于Calculator.conversion()方法EmptyStackException的bug(pr#2076@Github)
2728

2829
-------------------------------------------------------------------------------------------------------------
2930
# 5.7.18 (2021-12-25)

hutool-core/src/test/java/cn/hutool/core/math/CalculatorTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cn.hutool.core.math;
22

33
import org.junit.Assert;
4-
import org.junit.Ignore;
54
import org.junit.Test;
65

76
public class CalculatorTest {
@@ -42,4 +41,11 @@ public void conversationTest6() {
4241
final double conversion = Calculator.conversion("-((2.12-2) * 100)");
4342
Assert.assertEquals(-1D * (2.12 - 2) * 100, conversion, 2);
4443
}
44+
45+
@Test
46+
public void conversationTest7() {
47+
//https://gitee.com/dromara/hutool/issues/I4KONB
48+
final double conversion = Calculator.conversion("((-2395+0) * 0.3+140.24+35+90)/30");
49+
Assert.assertEquals(-15.11, conversion, 2);
50+
}
4551
}

0 commit comments

Comments
 (0)