+ 3
what is the different between double and float data type in c????????
can we use either double or float everywhere
3 Answers
+ 4
Doubles allow for greater precision.
+ 3
float: 4 bytes, single precision (8 decimals exact)
double: 8 bytes, double precision (16 decimals exact)
So it depends on your context.
You can go with double almost everywhere.
If memory is very limited (e.g. micro controllers) you may want to use float if single precision is enough for your application.