The types float, double, and long double represent floating-point single-, double-, and extended-precision values. Typically, floats are represented in one word (32 bits), doubles in two words (64 bits), and long double in either three or four words (96 or 128 bits). The size of the type determines the number of significant digits a floating-point value might contain.
The float type is usually not precise enough for real programs—float is guaranteed to offer only 6 significant digits. The double type guarantees at least 10 significant digits, which is sufficient formost calculations.
程序里如果用到浮点数, 应该默认用double类型,少用float 类型。