Float versus Double

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colinNeedsJavaHelp
    New Member
    • Feb 2007
    • 22

    Float versus Double

    I was just wondering if someone could explain the difference of these
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by colinNeedsJavaH elp
    I was just wondering if someone could explain the difference of these
    For starters, double is bigger than float.
    Double is also the default type for primitives with a decimal point. You can read about each of them in the tutorials and finish up the list of their differences on your own.

    Comment

    • horace1
      Recognized Expert Top Contributor
      • Nov 2006
      • 1510

      #3
      Originally posted by colinNeedsJavaH elp
      I was just wondering if someone could explain the difference of these
      this is a good tutorial on the java primitive data types
      http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html

      also
      http://en.wikipedia.or g/wiki/IEEE_754#Single-precision_32_bi t

      in practice you analyse the data you are using in the application and select the most appropriate data types. for example if the data inputted is accurate to 3 or 4 siginficant figures use a float (typical precision 6 or 7 significant figures) - no need for the greater precision of double and calculations in double take longer than float

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        thanx ....

        good links

        Comment

        Working...