Can the range for double in Java be extended?

126 views Asked by At

The data type double covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d. If I have to deal with numbers less than 4.94065645841246544e-324d, is there a data type I can use?

1

There are 1 answers

0
Elliott Frisch On

Is there a data type I can use?

Yes1. You might use BigDecimal. The linked Javadoc says (in part) that it provides immutable, arbitrary-precision signed decimal numbers.

1BigDecimal is not a primtive type (and the range of primtive types is mandated by the specification).