+ 1
What is the difference between a float and a double? In C++
what is the difference b/w a float and a double in C++? I dont get it, its twice the size? But how? Also, can you explain what is the difference between short, long, long double and int. sorry i am a noob to programming.
3 Answers
+ 2
In the x86 architecture (on normal PCs), float has a precisity of 6.9 digits and double has a precisity of 15.7 digits.
0
double is more precise, but it takes twice as much memory as float
short is an integer variable with small range (usually 2^15)
int has usually 2^31
long long int has usually 2^63
the biggest the range of possible values is, the more meiymory the variable takes