Connecting Tech Pros Worldwide Help | Site Map

float/double

Newbie
 
Join Date: Sep 2009
Posts: 9
#1: Oct 4 '09
what is the difference between float and double. both dealt with decimal point but i dont know wat is the real difference between those two terms.
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,156
#2: Oct 5 '09

re: float/double


float is normally called single precision and double is double precision.

On most common implementations a float is 32 bits (4 bytes) and a double is 64 bits (8 bytes). Because of this increase in memory usage a double can (normally) hold 15 significant digits where as a float holds 7. A Double can also hold a much much larger range of numbers than a float.

With today's computers with excess memory the normal rule of thumb is to use the double type unless you have a communicatable reason why you need to use floats.
Expert
 
Join Date: Mar 2008
Location: Naperville, Illinois U.S.
Posts: 828
#3: Oct 5 '09

re: float/double


Think of it being analogous to the difference between short and long.
Newbie
 
Join Date: Sep 2009
Posts: 9
#4: Oct 5 '09

re: float/double


thank you vey much. that info was helpful for me
Reply