I was reading about data types in C. I found the range of long double is more than that of double in java. For very huge number we can use long double in C. If I want to store the same number in java what we have to do? which datatype we can use?
double in java takes 8 bytes(64 bits) IEEE 754. it Covers a range from
4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative).
longdouble in c takes 10 bytes (80 bits)
Can anyone tell me is there any replacement of longdouble in java
Though not a replacement, you can use java.lang.math.BigDecimal.You can roughly store billion of digits until you run out of memory. Its an arbitrary precision class, it will get as large as you’d like until your computer runs out of memory.
As per the documentation of BigDecimal: