Why is a float “single precision”?

巧了我就是萌 提交于 2020-05-25 06:53:05

问题


I'm curious as to why the IEEE calls a 32 bit floating point number single precision. Was it just a means of standardization, or does 'single' actually refer to a single 'something'.

Is it simply a standardized level? As in, precision level 1 (single), precision level 2 (double) and so on? I've searched all over and found a great deal about the history of floating point numbers, but nothing that quite answers my question.


回答1:


On the machine I was working on at the time, a float occupied a single 36 bit register. A double occupied two 36 bit registers. The hardware had separate instructions for operating on the 1 register and 2 register versions of the number. I don't know for certain that that's where the terminology came from, but it's possible.




回答2:


In addition to the hardware view, on most systems the 32-bit format was used to implement the Fortran "real" type, and the 64 bit format to implement the Fortran "double precision" type.




回答3:


I think it just refers to the number of bits used to represent the floating-point number, where single-precision uses 32 bits and double-precision uses 64 bits, i.e. double the number of bits.




回答4:


The terminology "double" isn't quite correct, but it's close enough.

A 64 bit float uses 52 of the bits for the fraction instead of the 23 bits used for the fraction in a 32 bit float - it's not really "double", but it does use double the total bits.

The answer to this question is very interesting - you should give it a read.



来源:https://stackoverflow.com/questions/17755492/why-is-a-float-single-precision

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!