I have a double with a decimal length of 40+.You have a double with 53 binary digits of mantissa just like evey other double. This is 15.9 decimal digits. You can write more trailing decimal digits in a Java double literal, but they get truncated on the way in, by the compiler, not on the way out by decimal formatting.
992895 wrote:Of course, it gives you arbitrary precision.
and it definitely gives me 32 non-truncated decimal digits
but I think it's from the next storage in memory.Well obviously more precision means more memory.
So, I'm gonna go with double for now before I change everything over to BigDecimal, see if the program is effectiveThere are certain situations where BigDecimal is required, such as when you're dealing with money. However, often double is enough.
then decide if BigDecimal lis the way to go or not (slows down the program, no)?The decision between using double and BigDecimal is not about performance. Also unless you're doing heavy calculations I doubt you'd notice the difference.
This is a great forum and I look forward to posting more questions! (As there will be more questions)!In that case welcome to the forums!