(原創) 浮点运算时,该使用float还是double? (C/C++) (C)

C++ Primer 4th P.38 ,对 float double 做了以下的建议

Determining which floating-point type to use is easier: It is almost always right to use double. The loss of precission implicit in float is significant, whereas the cost of double precision calculations versus single precision is negligible. In fact, on some machines, double precision is faster than single.



Reference
C++ Primer 4th P.38

你可能感兴趣的:(double)