BigDecimal unscaledValue() in Java Last Updated : 04 Dec, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The java.math.BigDecimal.unscaledValue() is an inbuilt method in java that returns a BigInteger whose value is the unscaled value of a BigDecimal value. The value computes (this * 10this.scale()). Syntax: public BigInteger unscaledValue() Parameters: The method does not accepts any parameter. Return value: This method returns a BigInteger whose value is the unscaled value of this BigDecimal value. Below program illustrates the BigDecimal.unscaledValue() method: Program 1: Java // Program to illustrate unscaledValue() method of BigDecimal import java.math.*; public class Gfg { public static void main(String[] args) { // Creating 2 BigInteger objects BigInteger i1, i2; BigDecimal b1 = new BigDecimal("175.856"); BigDecimal b2 = new BigDecimal("-275.73"); // Assigning unscaledValue of BigDecimal objects b1, b2 to i1, i2 i1 = b1.unscaledValue(); i2 = b2.unscaledValue(); // Printing i1, i2 values System.out.println("The Unscaled Value of " + b1 + " is " + i1); System.out.println("The Unscaled Value of " + b2 + " is " + i2); } } Output: The Unscaled Value of 175.856 is 175856 The Unscaled Value of -275.73 is -27573 Program 2: Java // Program to illustrate unscaledValue() method of BigDecimal import java.math.*; public class Gfg { public static void main(String[] args) { // Creating 2 BigInteger objects BigInteger i1, i2; BigDecimal b1 = new BigDecimal("5.5"); BigDecimal b2 = new BigDecimal("-2.73"); // Assigning unscaledValue of BigDecimal objects b1, b2 to i1, i2 i1 = b1.unscaledValue(); i2 = b2.unscaledValue(); // Printing i1, i2 values System.out.println("The Unscaled Value of " + b1 + " is " + i1); System.out.println("The Unscaled Value of " + b2 + " is " + i2); } } Output: The Unscaled Value of 5.5 is 55 The Unscaled Value of -2.73 is -273 Reference: https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#unscaledValue() Comment More infoAdvertise with us Next Article BigDecimal unscaledValue() in Java T Twinkl Bajaj Follow Improve Article Tags : Misc Java Java-Functions java-math Java-BigDecimal Java-math-package +2 More Practice Tags : JavaMisc Similar Reads BigDecimal valueOf() Method in Java java.math.BigDecimal.valueOf(long val) is an inbuilt method in Java that translates a long value into a BigDecimal value with a scale of zero. It allows us, the reuse of frequently used BigDecimal values and hence this "static factory method" is provided in preference to a (long) constructor. Packag 3 min read BigDecimal scale() Method in Java The java.math.BigDecimal.scale() is an inbuilt method in java that returns the scale of this BigDecimal. For zero or positive value, the scale is the number of digits to the right of the decimal point. For negative value, the unscaled value of the number is multiplied by ten to the power of the nega 2 min read BigDecimal longValue() Method in Java The java.math.BigDecimal.longValue() is an in-built function which converts this BigDecimal to a long value. This function discards any fractional part of this BigDecimal. The function returns only the lower-order 64 bits when the result of the conversion is too big to be represented as a long value 2 min read BigDecimal plus() method in Java The java.math.BigDecimal.plus() is an inbuilt method in java that returns a BigDecimal whose value is (+this), and whose scale is this.scale(). This method, which simply returns this BigDecimal is included for symmetry with the unary minus method negate().Syntax: public BigDecimal plus()Parameters: 3 min read BigDecimal ulp() Method in Java The java.math.BigDecimal.ulp() is an inbuilt method in Java that returns the size of an ulp(unit in the last place) of this BigDecimal. An ulp of a nonzero BigDecimal value is defined as the positive distance between this value and the BigDecimal value next larger in magnitude with the same number o 2 min read Like