单精度浮点数和双精度浮点数_浮点数和双精度数之间的区别

单精度浮点数和双精度浮点数

Here you will learn about difference between float and double i.e. float vs double.

在这里,您将了解float和double的区别,即float vs double。

These are two commonly used floating point data types in programming languages like C, C++, Java, etc. Both float and double are used to store values with decimal point but there are some differences between them that are mentioned below.

这是C,C ++,Java等编程语言中两种常用的浮点数据类型。float和double都用于存储带小数点的值,但是下面将提到它们之间的一些区别。

float vs double – float和double之差 (float vs double – Difference between float and double)

 FloatDouble
PrecisionSingle precision (1 bit for sign, 8 bits for exponent, 23 bits for fraction)Double precision (1 bit for sign, 11 bits for exponent, 52 bits for fraction)
Size4 Bytes (32 Bits)8 Bytes (64 Bits)
Range-3.4E+38 to +3.4E+38-1.7E+308 to +1.7E+308
Accuracy6 decimal digits15 decimal digits
  浮动
精确 单精度(1位为符号,8位为指数,23位为分数) 双精度(1位表示符号,11位表示指数,52位表示分数)
尺寸 4个字节(32位) 8字节(64位)
范围 -3.4E + 38至+ 3.4E + 38 -1.7E + 308至+ 1.7E + 308
准确性 6个十进制数字 15位小数

Comment below if you have queries related to above tutorial for float vs double.

如果您对以上教程中的float vs double有疑问,请在下面评论。

翻译自: https://www.thecrazyprogrammer.com/2018/01/difference-float-double.html

单精度浮点数和双精度浮点数

  • 8
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值