Java.math.BigDecimal Class Java.math.BigDecimal.multiply() Method - Java.math Package

What is Java math BigDecimal multiply() Method?


The java.math.BigDecimal.multiply(BigDecimal multiplicand, MathContext mc) returns a BigDecimal whose price is (this × multiplicand), with rounding in line with the context settings.


Following is the declaration for java.math.BigDecimal.multiply() technique.


  • Multiplicand − Value to be multiplied by this BigDecimal.
  • Mc − The context to use.

Return Value

This technique returns a BigDecimal whose value this * multiplicand, rounded as necessary.


Arithmetic Exception − If the result is inexact but the rounding mode is UNNECESSARY.


The following example shows the usage of math.BigDecimal.multiply()technique.

Let us compile and run the above program, this will produce the following result −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Java.math Package Topics