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

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

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

posted on 2006-10-04 16:18  真 OO无双  阅读(2508)  评论(3编辑  收藏  举报

导航