Java BigDecimal doubleValue() methodThe doubleValue() method of Java BigDecimal class is used to convert the BigDecimal value into a double type. If BigDecimal has very big value represented as a double, it will be converted to Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY as appropriate. While conversion, we can lose information about the precision of the BigDecimal value. Syntax:Parameter:No Exception:No Returns:It returns double value converted from BigDecimal. Example 1Test it NowOutput: BigDecimal 123 value converted into double is =123.0 Example 2Test it NowOutput: BigDecimal 113367 value converted in to double is =113367.0 Example 3Test it NowOutput: BigDecimal -1120 value converted in to double is = -1120.0 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