首页 > 编程知识 正文

双精度浮点数与单精度浮点数的区别,单精度浮点数和双精度浮点数有什么区别

时间:2023-05-03 19:03:09 阅读:228776 作者:2339

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

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)  FloatDoublePrecisionSingle 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+308Accuracy6 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

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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。