A value containing a decimal point is assumed to be the 64-bit double, : double « Java Source And Data Type « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Java Source And Data Type » double 
1.14.3.A value containing a decimal point is assumed to be the 64-bit double,
unless you append an F or f to indicate the 32-bit float primitive.

public class MainClass {
  public static void main(String[] argv) {
    double f2 = 1.023// double is assumed
    float d2 = 1.023F// F or f makes it a float

    System.out.println();
  }
}
1.14.double
1.14.1.Attach a D or d to double literals, but it is not necessary.
1.14.2.NaN values indicates that a calculation has no result in ordinary arithmetic
1.14.3.A value containing a decimal point is assumed to be the 64-bit double,
1.14.4.Division by zero in floating-point-arithmetic: No exception occurs;
1.14.5.See if a floating-point result is NaN, use the Float.isNaN or Double.isNaN static method.
1.14.6.Float and Double classes define MAX_VALUE, MIN_VALUE, POSITIVE_INFINITY, and NEGATIVE_INFINITY.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.