BigDecimal param = new BigDecimal(String.valueOf(0.3));
BigDecimal result = new BigDecimal(3);
System.out.println(result.multiply(param).doubleValue());
The elements of the types float and double are those values that can be represented using the IEEE 754 32-bit single-precision and 64-bit double-precision binary floating-point formats, respectively.
The details of proper input conversion from a Unicode string representation of a floating-point number to the internal IEEE 754 binary floating-point representation are described for the methods valueOf of class Float and class Double of the package java.lang.