Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加完善功能 #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
范围从BigDecimal拓展到Number
  • Loading branch information
albert committed Jul 18, 2019

Verified

This commit was signed with the committer’s verified signature.
commit 9c4eb24784dfda83af218d8282f7ef0c79692dca
11 changes: 11 additions & 0 deletions src/test/java/com/sunchp/utils/math/BigDecimalLogicTest.java
Original file line number Diff line number Diff line change
@@ -14,14 +14,25 @@ public class BigDecimalLogicTest {
BigDecimal three = new BigDecimal("6.521");
BigDecimal four = new BigDecimal("6.521");
BigDecimal five = null;
double aDouble = 6.521;
float aFloat = 6.521F;



@Test
public void testTwoBigdecimalsEquality() {


assertTrue(is(three).eq(four));
assertTrue(is(one).eq(one));
assertTrue(!is(one).eq(two));
assertTrue(is(three).eq("6.521"));
assertTrue(is(three).eq(aDouble));
assertTrue(is(three).eq(aFloat));
assertTrue(is("1").eq("1"));
assertTrue(is("0.1").eq("0.1"));
assertTrue(is(0.1D).eq(0.1F));
assertTrue(is((float)0.1D).eq(0.1F));
}

@Test