Use int for integer numbers ex: 1 , 9, 100 , -1 , -5
Use float for rational numbers with up to about 7: 0.000000009f , 1.234f , 1.30003f 1222.231f //excluding the zeros
Use double for twice the precision of floats 1.22222222222 , 1.999999 12222.2321
You have many choices when it comes to the fundamental types. So how do you know which type to use? well, if you need an integer value, you're best off using int, that's because int is generally implemented so that it occupies an amount of memory that is most efficiently handled by the computer and if you need a floating pointer number (ex: 1.5251) you're best off using float, which again is likely to be implemented so that it occupies an amount of memory that is most efficiently handled by the computer.
If you need to use a long double you are using some really large numbers and would probably be better off just making a custom class IMO to make it more precise ( for integers anyways ).
@giblit: unless you need so much precision that you don't care for the efficiency, making your own class instead of using long double directly seems like a really bad idea.
I'm not sure about performance but it would be slightly more accurate if you really cared about like 100000000000000000000000000000000000000000 + 1000000000000000000000000000000000000000000
> If you need to use a long double you are using some really large numbers
The range of longdouble is not all that much larger than the range of double on most architectures.
For instance, on GCC x86 and x86_64, the value representation of a longdouble is 10 bytes (80-bit extended precision format). sizeof( longdouble ), which is the amount of memory occupied by the object representation of longdouble is a larger value (12 or 16 bytes) to meet alignment requirements. SSE/SSE2/SSE3 instructions, which are limited to operations on (multiples of) 64-bits, are way faster than operations on the archaic FPU x87 which supports 80-bit floating point operations.
GCC 4.3 and above on x86_64 has a (nonstandard) __float128 type which has true quadruple precision.