+ 2
What is the difference between "double" and "float"?
3 Respuestas
+ 3
" In most modern architectures, a float is 4 bytes, a double is 8, and a long double can be equivalent to a double (8 bytes), or 16 bytes.
..."
Sources:
https://www.sololearn.com/learn/CPlusPlus/1622/?ref=app
https://www.sololearn.com/learn/1345/?ref=app
"Difference between float and double in C/C++"
https://www.geeksforgeeks.org/difference-float-double-c-cpp/
+ 2
A small correction. On x86-64, the size of long double is 10 bytes (because that's how much the processor can handle). In ARM64 it's 8 byes.
- 1
double alocate 2x more number info than float. so if a float uses 8bits,double use 16. if you don't have a small circuit with memory limitations, you can use double without any fear.