整數存儲怎么轉化為浮點數
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/
整數存儲怎么轉化為浮點數