It seems like the smallest non-zero number that google's calculator can calculate is 2^-1023. I.e. 2^-1024 equal 0.
In JAVA Double.MIN_VALUE is 2^-1074.
When reading about JAVA's Double.MIN_VALUE here and across the Internet there are many mentions of IEEE 754 but none of them actually says that 2^-1074 is the smallest non zero number that is defined in IEEE 754.
So my questions are:
- How does JAVA's Double.MIN_VALUE relate to IEEE 754's definition of the smallest non-zero number? Is there such a thing at all?
- Why does Google's calculator cannot calculate smaller numbers than 2^-1023 when apparently there are such numbers? (I know people don't use them every day but still, programming languages allow it)
- In JAVA, if Double.MIN_VALUE == 4.9E-324 then why (Double.MIN_VALUE + Double.MIN_VALUE) == 1.0E-323 and not 9.8E-324, considering that (4.9E-5 + 4.9E-5) == 9.8E-5?
- How much should I add to Double.MIN_VALUE in order to make it equal zero?
Here is the program I made on these questions:
public class Lecture {
public static void main(String[] args) {
double min = Double.MIN_VALUE;
double max = Double.MAX_VALUE;
double minPlusOne = min + 0.0001;
System.out.println("Min + 1: " + minPlusOne);
System.out.println("Double.MIN_VALUE: " + min);
System.out.println("Double.MIN_VALUE: " + max);
double myMin = Math.pow(2, -1074);
System.out.println("2^-1074: " + myMin);
System.out.println("Double.MIN_VALUE == 2^-1074: " + (min == myMin));
System.out.println();
System.out.println("Changed Min:" + (min + min));
double a = 4.9E-5;
double b = a + a;
System.out.println(b);
}
}
EDIT: As asked, removing the follow up questions.