How many significant digits should I use when defining a double
literal in Java? This is assuming that I am trying to represent a number with more significant figures than a double can hold.
In Math.java
I see 20 and 21:
public static final double E = 2.7182818284590452354;
public static final double PI = 3.14159265358979323846;
This is more than the 15-17 significant digits provided by IEEE 754. So what's the general rule-of-thumb?