Java examples for Language Basics:double
Special Constants of the float and double Classes
Constant | Meaning |
---|---|
POSITIVE_INFINITY | Positive infinity |
NEGATIVE_INFINITY | Negative infinity |
NaN | Not a number |
public class Main { public static void main(String[] args) { double i = 50.0; double j = 0.0; double k = i / j; System.out.println(k);//from w ww. jav a2 s .co m i = -50.0; k = i / j; System.out.println(k); i = 0.0; k = i / j; System.out.println(k); } }