整数存储怎么转化为浮点数
by Shukant Pal
通过Shukant Pal
非整数值如何存储在浮点数中(以及为什么要浮点数) (How non-integer values are stored in a float (and why it floats))
Did you ever think how computers work on floating-point numbers? I mean — where does the decimal point go? What if you’re asked in an interview?
您是否曾经想到计算机如何在浮点数上工作? 我的意思是-小数点在哪里? 如果在面试中被问到怎么办?
The IEEE 754 floating-point standard defines how non-integer values are encoded in fixed-size types, like the C++ float and the JavaScript Number. It gives us five different formats — but no worries, all of them…
IEEE 754浮点标准定义了如何将非整数值编码为固定大小的类型,例如C ++ float和JavaScript Number。 它为我们提供了五种不同的格式-不用担心,所有这些……
翻译自: https://www.freecodecamp.org/news/how-non-integer-values-are-stored-in-a-float-and-why-it-floats-902effacbfb9/
整数存储怎么转化为浮点数