Java BigDecimal multiply() methodThe multiply() method of java BigDecimal class is used to obtain a BigDecimal whose value is (this � multiplicand), and whose scale is (this.scale() + multiplicand.scale()) with rounding according to the context settings. Syntax:Parameter:multiplicand: value to be multiplied by this BigDecimal. mc: the context to use. Exception:ArithmeticException- if the result is inexact but the rounding mode is UNNECESSARY, then it throws exception : Returns:It returns this*multiplicand, rounded as necessary. Example 1Test it NowOutput: Multiplication of 34.203 and 44.25 is =1513.48275 Example 2Test it NowOutput: Multiplication of -67 and 25 is = -1675 Example 3Test it NowOutput: Multiplication of -120 and -35 is = 4200 Next TopicJava BigDecimal |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India