Skip to content

Instantly share code, notes, and snippets.

@springcome
Last active October 28, 2015 01:27
Show Gist options
  • Select an option

  • Save springcome/191e83bd1ebf3f4e60cd to your computer and use it in GitHub Desktop.

Select an option

Save springcome/191e83bd1ebf3f4e60cd to your computer and use it in GitHub Desktop.
BigDecimal one = BigDecimal.ONE;
BigDecimal zero = BigDecimal.ZERO;
// 같으면 참
if (one.compareTo(zero) == 0) {
// one이랑 zero가 같음
}
// 크면 참
if (one.compareTo(zero) == 1) {
// one이 zero보다 큼
}
// 작으면 참
if (one.compareTo(zero) == -1) {
// one이 zero보다 작음
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment