Return | Method |
---|---|
BigDecimal | abs() |
BigDecimal | abs(MathContext mc) |
BigDecimal | add(BigDecimal augend) |
BigDecimal | add(BigDecimal augend, MathContext mc) |
BigDecimal | divide(BigDecimal divisor) |
BigDecimal | divide(BigDecimal divisor, int roundingMode) |
BigDecimal | divide(BigDecimal divisor, int scale, int roundingMode) |
BigDecimal | divide(BigDecimal divisor, int scale, RoundingMode roundingMode) |
BigDecimal | divide(BigDecimal divisor, MathContext mc) |
BigDecimal | divide(BigDecimal divisor, RoundingMode roundingMode) |
BigDecimal[] | divideAndRemainder(BigDecimal divisor) |
BigDecimal[] | divideAndRemainder(BigDecimal divisor, MathContext mc) |
BigDecimal | divideToIntegralValue(BigDecimal divisor) |
BigDecimal | divideToIntegralValue(BigDecimal divisor, MathContext mc) |
BigDecimal | max(BigDecimal val) |
BigDecimal | min(BigDecimal val) |
BigDecimal | multiply(BigDecimal multiplicand) |
BigDecimal | multiply(BigDecimal multiplicand, MathContext mc) |
BigDecimal | negate() |
BigDecimal | negate(MathContext mc) |
BigDecimal | plus() |
BigDecimal | plus(MathContext mc) |
BigDecimal | pow(int n) |
BigDecimal | pow(int n, MathContext mc) |
BigDecimal | remainder(BigDecimal divisor) |
BigDecimal | remainder(BigDecimal divisor, MathContext mc) |
BigDecimal | round(MathContext mc) |
BigDecimal | scaleByPowerOfTen(int n) |
BigDecimal | subtract(BigDecimal subtrahend) |
BigDecimal | subtract(BigDecimal subtrahend, MathContext mc) |
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
BigDecimal first = new BigDecimal(-1f);
System.out.println(first);
System.out.println(first.abs());
}
}
The output:
-1
1
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
BigDecimal first = new BigDecimal(-1f);
BigDecimal second = new BigDecimal(10f);
BigDecimal result = first.add(second);
System.out.println(result);
}
}
The output:
9
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |