设为首页 加入收藏

TOP

2.1.2 Floating-Point Types
2013-10-07 15:23:22 来源: 作者: 【 】 浏览:79
Tags:2.1.2 Floating-Point Types

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 类型。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇2.3.1 What Is a Variable? 下一篇2.4.2 少量迭代的小循环体

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Sphinx : 高性能SQL (2025-12-24 10:18:11)
·Pandas 性能优化 - (2025-12-24 10:18:08)
·MySQL 索引 - 菜鸟教 (2025-12-24 10:18:06)
·Shell 基本运算符 - (2025-12-24 09:52:56)
·Shell 函数 | 菜鸟教 (2025-12-24 09:52:54)