There are 3 special columns in the Java floating-point data, positive infinity, negative infinity, and non-number.
The positive number is divided by the floating point 0 to get the positive infinity;
Negative infinity is obtained by dividing the number by the floating-point number 0;
Floating-point number 0 divided by floating-point 0 to get non-numbers (NaN);
public class Floattest {
public static void Main (string[] args) {
Float af = 8.15464156f;
The value of AF will change
SYSTEM.OUT.PRINTLN (AF);
Double A = 0.0;
Double C = double.negative_infinity;
float d = float.negative_infinity;
The negative infinity of float and double is equal
System.out.println (c = = d);
0.0/0.0 will appear non-number
System.out.println (a/a);
Two non-numbers are not equal
System.out.println (a/a = = Float.nan);
All positive infinity are mostly equal.
System.out.println ((1.0/0) = = (2.0/0));
Negative number divided by 0.0 to get negative infinity
System.out.println ( -1/a);
Integers divided by 0 will throw an exception
System.out.println (0/0);
}
}