Reputation: 145
Since the double data type has the longest range in Java, yet there could be a few cases when the value of data can exceed its range. So, How can we do calculation on values exceeding the double data type and prevent any error in java?
Upvotes: 0
Views: 223
Reputation: 101
I believe BigDecimal is usually used in this case. It can handle very large doubles and is quite precise. Here's a tutorial I found on using BigDecimal.
Upvotes: 1