364,083 Members | 5938 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Float versus Double

colinNeedsJavaHelp
P: 22
I was just wondering if someone could explain the difference of these
Feb 19 '07 #1
Share this Question
Share on Google+
3 Replies


r035198x
10K+
P: 10,083
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.
Feb 19 '07 #2

horace1
Expert 100+
P: 1,464
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.org/wiki/IEEE_754#Single-precision_32_bit

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
Feb 19 '07 #3

dmjpro
100+
P: 2,474
thanx ....

good links
Feb 20 '07 #4

Post your reply

Help answer this question



Didn't find the answer to your Java question?

You can also browse similar questions: Java