I was just wondering if someone could explain the difference of these
Float versus Double
Collapse
X
-
Tags: None
-
For starters, double is bigger than float.Originally posted by colinNeedsJavaH elpI was just wondering if someone could explain the difference of these
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. -
this is a good tutorial on the java primitive data typesOriginally posted by colinNeedsJavaH elpI was just wondering if someone could explain the difference of these
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 floatComment
Comment